SkyvrawleR
SkyvrawleR

Reputation: 412

Multiple View Layout Framework7 Hybrid Application

I have 2 different layouts. One for before login and one more for after login.

I already read the instructions here. http://framework7.io/docs/views.html

And still cant understand why my apps become like this:

Middle part of this application

It display 2 views at once. Can scroll fully throught both views.

This is the js involved:

var mainView = myApp.addView('.view-main');
var anotherView = myApp.addView('.another-view');

//to call anotherView after login
mainView.router.load(anotherView);

Upvotes: 2

Views: 1574

Answers (1)

Teo
Teo

Reputation: 240

Each view is simply a div with its own content and its own history. So, just use them as divs:

var mainView = myApp.addView('.view-main');
var anotherView = myApp.addView('.another-view');
//init your application somwhere here
$$('.another-view').hide(); //hide view that after login
//do somethig and login
$$('.view-main').hide(); //hide view that before login
$$('.another-view').show(); //show wiew that after login

Of course, this is very strange way to use views but i hope you know what you doing. Please, read documentation again.

Upvotes: 1

Related Questions