iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello Crosslight Support,
I am using a drawer navigation. When starting the app, the initial screen/view shows the first navigation item of the drawer navigation. This item isn't highlighted. When navigating to other screens/views the belonging navigation item is highlighted. When navigating back to the initial screen/view it is highlighted, too.
How can I initially highlight the "startup" navigation item in a drawer (iOS and Android)?
Thanks,
Thomas
Hello Yudi,
I haven't explicitly tested the bug fix but I references the "Update 4" assemblies in a project which uses the drawer. Without any changes in my code the navigation elements in the drawer where selected. So, I think it works.
Thank you for your valuable feedback regarding the selected state on navigation drawer.
I have submitted the problems to Crosslight development team. It is filed under backlog: CROS-429.
I will keep this thread updated with any news I heard from the team regarding CROS-429.
CROS-429 is not available in Crosslight 2.0 Update 3 Release Notes. It is in progress state and not yet resolved.
I'd like to inform you that a nightly build hotfix is available which resolves the problem submitted under CROS-429 for iOS platform. The nightly build is available in here.
Please have the nightly build hotfix evaluated on your and let me know whether it helps or not.
Please note that you need to follow the steps below in order to apply selected state in navigation drawer:
this.DrawerSettings.AutoSynchronizeSelection = true;
protected override void InitializeView() { base.InitializeView(); // set TableView header this.Appearance.HeaderViewNibName = "HeaderTableView"; this.Appearance.FooterViewNibName = "FooterTableView"; this.ClearsSelectionOnViewWillAppear = false; // set navigation title this.NavigationItem.Title = "Crosslight App"; }
public override bool DeselectRowOnNavigate { get { return false; } }
Glad to hear that applying Crosslight 2 Update 4 resolve the selected state in drawer navigation.
Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.
I have to reopen this.
As you described in one of the entries above, the preselection works fine on iOS.
Now, I need this (app starts, shown view is selected in drawer navigation) on Android, too. I couldn't find out how.
Do you have any sample for Android?
For Android platform, please ensure that binding to SelectedItem property has been added in BindingProvider (as seen in the following snippet code).
public NavigationBindingProvider() { ItemBindingDescription itemBinding = new ItemBindingDescription() { DisplayMemberPath = "Title", NavigateMemberPath = "Target" }; ... this.AddBinding("TableView", BindableProperties.SelectedItemProperty, "SelectedItem", BindingMode.TwoWay); }
The DrawerSamples project on Android emulator (using Crosslight 3) shows that preselection works on Android.
Hope this helps.
you are right with the plain DrawerSample, but please have a look at the WorthyStyleDrawerSample.
In the BindingProvider the SelectedItem is bound but it is not selected at startup.
Maybe it is because the drawer is not open when starting the app or it is because of a custom list item template. I have the same scenario in my app and there is no selected list item, too.
I haven't tried on iOS. Maybe you could do this, too.
WorthyStyleDrawerSample uses custom list item template. Please follow the steps below in order to apply the style for drawer preselection.
<style name="ListItem"> <item name="android:background">@color/listviewbackgroundselector</item> </style> <style name="Theme.Splash" parent="android:Theme">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" style="@style/ListItem"> ...
Save the changes and the preselection on drawer should look like below.
Hope this help.
Thanks you for the explanation, I will test this today and give feedback.
it works somehow. But for my needs it is not the required solution.
Anyway, I think you can close this thread.
My needs are described in another post (http://www.intersoftpt.com/Community/Crosslight/Crosslight-ListView-Styling/).
In general, a greater emphasis on custom styling and setting styles, colors, ... in code would be nice.
I have to reopen this, because it no longer works like this.
The initial question here was, how can I select the first navigation item of the drawer navigation when starting an app.
Your solution for iOS was:
this.DrawerSettings.AutoSynchronizeSelection = true; (DrawerViewController)
this.ClearsSelectionOnViewWillAppear = false; (NavigationViewController)
public override bool DeselectRowOnNavigate (NavigationViewController){ get { return false; }}
In the meantime, this causes a runtime error. How can I select the first navigation item of the drawer navigation when starting an app?
Please, provide an up to date solution or fix this bug.
I attached a video which shows a simple app with initial selection (its first navigation item) when start. As shown in the video, the reported problem: causes a runtime error, is not reproducible.
For your reference, I enclosed my test app as attachment.
Should you find anything that I miss during my attempt to reproduce the problem, please feel free to let me know.
the difference in my case is that I don't have an override for RefreshGroupItems in the NavigationViewModel. If you comment out this method you will get the error, too.
Maybe this is a misunderstanding from my side. Since, I have no grouped navigation, I thought I do not have to provide an override for this. I thought just keep the default would be fine. But obviously it is not.
Am I wrong here?
Thank you for the information. I can replicate the issue after removing RefreshGroupItems().
I have submitted the reported problem to Crosslight development team. It is filed under CROS-1168.
I will keep you updated with any news I heard from the team regarding CROS-1168.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname