Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Lisview grouping no working in android

SurbhiAroraaSurbhiAroraa Member ✭✭✭

GroupShortNameBinding not working in android but works for iOS. @JamesMontemagno @JohnMiller @LandLu @LeonLu TIA

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    GroupShortNameBinding is just worked in IOS for jump lists, It is optional property, please see the offical article.

  • DirkWilhelmDirkWilhelm USMember ✭✭✭✭✭

    As LeonLu said, jump lists are not available out of the box on android.

    But on Android you can use fastscrolling as an alternative.

    Add this to the namesapce configurations of your page:

    xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"

    and thten this to your listview:

    android:ListView.IsFastScrollEnabled="True"

    It should look like this in the page:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage x:Class="Fso.Mobile.Views.SchuelerListePage"
                 xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core">
    
    ...
    
            <ListView 
                      HasUnevenRows="true"
                      ItemsSource="{Binding GroupedList}"
                      IsGroupingEnabled="true"
                      GroupShortNameBinding="{Binding Key}"
                      android:ListView.IsFastScrollEnabled="True">
    ...
    
    

    Now if you scroll fast by pulling the scrollbar, the lisview will display a littel bubble with the GroupShortNameBinding while scrolling

  • SurbhiAroraaSurbhiAroraa Member ✭✭✭

    @DirkWilhelm @LeonLu is there any way where one can display listview as same as in iOS (GroupShortNameBinding on right side for quick jumping).

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    You can use RelativeLayout contians two listview like this thread:

    https://stackoverflow.com/questions/38737980/xamarin-vertical-alphabet-indexing-jump-list-for-grouped-list-in-xamarin-form

    Or you can use paid plugin to achieve it.

Sign In or Register to comment.