Xamarin Android ScrollView doesnt work in ListView

2019-08-21 17:53发布

问题:

I have a problem with ListView where I need have scroll view when I have there so much items, but ScrollView which implements ListView doesnt work... I dont know why... Can someone help me?

I have on half of screen OxyPlot view and under I have on another half screen my ListView where I need scrolling where are there so much items.....

Here is screen how looks my view:

Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <include
        layout="@layout/toolbar_back_layout" />
<!-- Test Top Layout -->
    <include
        layout="@layout/view_shopname_lastupdate_ribbon" />
<!-- Layout Date and Picker-->
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:background="@android:color/white"
        android:layout_height="50dp"
        android:paddingRight="20dp"
        android:paddingLeft="20dp"
        android:gravity="center_vertical">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:text="Období:"
            local:MvxLang="Text Period"
            android:textSize="16dp"
            android:textStyle="normal"
            android:textColor="@color/main_dark_gray"
            android:ellipsize="marquee"
            android:maxLines="1"
            android:gravity="center"
            android:layout_marginRight="10dp" />
        <MvxSpinner
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:id="@+id/periodSpinner"
            local:MvxBind="ItemsSource PeriodList; SelectedItem SelectedPeriod"
            android:spinnerMode="dropdown" />
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:layout_weight="1">
             <oxyplot.xamarin.android.PlotView
               android:id="@+id/dailySalesModel"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:layout_weight="1"
               android:background="@android:color/white" />
             <MvxListView
              android:id="@+id/dailySalesListView"
              android:layout_weight="1"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              local:MvxBind="ItemsSource DailySales"
              local:MvxItemTemplate="@layout/view_dailysalesitem"
              android:divider="@color/main_gray"
              android:dividerHeight="1dp"
              android:choiceMode="none"
              android:layout_gravity="start"
              android:background="@android:color/white"
              android:listSelector="@android:color/transparent"
              android:paddingTop="15dp" />
        </LinearLayout>
        <include
            layout="@layout/view_bottomribbon" />
    </LinearLayout>
</LinearLayout>

EggsToGo in my Fragment:

_easter = new Easter(new KonamiCode());

            var easyEgg = new CustomEgg("Easy")
                .WatchForSequence(Command.SwipeLeft(), Command.SwipeRight());

            _easter = new Easter(easyEgg);
            _easter.CommandDetected += cmd => DoSwipe(cmd.Value);

            var model = _view.FindViewById<PlotView>(Resource.Id.dailySalesModel);
            var listView = _view.FindViewById<MvxListView>(Resource.Id.dailySalesListView);
            model?.SetOnTouchListener(this);
            listView?.SetOnTouchListener(this);