我有一个ListView的问题,当我有那么多项目时我需要滚动视图,但是实现ListView的ScrollView不起作用......我不知道为什么......有人可以帮助我吗?
我有一半的屏幕OxyPlot视图,在我的另一半屏幕下我的ListView我需要滚动哪里有那么多的项目......
以下是我查看视图的屏幕:
这是我的代码:
<?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);