1

This is a prototype of the design : https://i.sstatic.net/JMDRA.png Im not able to have the listView scroll if it's inside the scrollview.Is there anyway i can go about while having the scroll view for the Mainlayout enabled as well as the scroll for the listView which is inside another layout.

1

3 Answers 3

2

Application developers should not nest one ScrollView within another. Additionally, they should refrain from nesting them other elements that can scroll, such as WebView.

Source: official doc.

Nested ScrollViews are disaster just don't do that. Which control will get scrolled on a user interaction? It will totally ruin the UX, performance and etc. You have to rethink your UI.

Sign up to request clarification or add additional context in comments.

Comments

1

Like @EvZ suggests you shouldn't have a Listview which already has a Scrollview inside a Scrollview but unfortunately we might end up in this situations.

You can use this custom renderer for Android to make all your listview work inside scrollviews.

[assembly: ExportRenderer(typeof(Xamarin.Forms.ListView), typeof(ListViewScrollRenderer))]

namespace Glu.Droid.Renderers
{
    public class ListViewScrollRenderer : ListViewRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ListView> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                var listView = this.Control as Android.Widget.ListView;
                listView.NestedScrollingEnabled = true;
            }
        }
    }
}

Comments

1

Don't use nested scrollview, instead what you can do is have buttons instead of listviews and on click of that show listview as a different controller as popup.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.