android - Xamarin Forms Java.Lang.IllegalArgumentException: DrawerLayout must be measured with MeasureSpec.EXACTLY -
i'm using auth0 xamarin forms pcl library. have following mainpage class :
namespace loginpattern { public class mainpage : masterdetailpage { public mainpage () { master = new menupage (); detail = new detailpage (); } } } and following in application class
public app () { current = this; login (); } public void showmainpage () { mainpage = new mainpage (); } public async void login () { await dependencyservice.get<iauth0widgetlogin>().loginuseauth0embeddedwidget(); app.current.properties["isloggedin"] = true; showmainpage (); } hence upon login, i'm not loading page except auth0 login widget. upon successful login display masterdetailpage. getting following error : java.lang.illegalargumentexception: drawerlayout must measured measurespec.exactly.
please advise if need load widget in navigationpage , how so.
edit 17/7 :
public class menupage : contentpage { masterdetailpage master; tableview tableview; public menupage () { title = "loginpattern"; icon = "slideout.png"; var section = new tablesection () { new textcell {text = "sessions"}, new textcell {text = "speakers"}, new textcell {text = "favorites"}, new textcell {text = "room plan"}, new textcell {text = "map"}, }; var root = new tableroot () {section} ; tableview = new tableview () { root = root, intent = tableintent.menu, }; var logoutbutton = new button { text = "logout" }; logoutbutton.clicked += (sender, e) => { app.current.logout(); }; content = new stacklayout { backgroundcolor = color.gray, verticaloptions = layoutoptions.fillandexpand, children = { tableview, logoutbutton } }; } } public class detailpage : contentpage { public detailpage () { backgroundcolor = new color (0, 0, 1, 0.2); var text = "slide > see master / menu"; if (device.os == targetplatform.android) { text = @"click action bar dots see master / menu"; } else if (device.os == targetplatform.winphone) { text = @"click button \/ see master / menu "; } content = new stacklayout { horizontaloptions = layoutoptions.center, padding = new thickness (10, 40, 10, 10), children = { new label { text = text } } }; } }
i try doing 2 things:
- setting mainpage of application blank page (or splash page) before attempt display authentication widget.
- setting explicit width request on menupage.
Comments
Post a Comment