アクティビティの設計に問題があります。
Mvx.MvxBindableLinearLayout を使用して、リストにバインドしようとしています: A、B、および c;
このバインディングを行うと、結果は次のようになります: A B C C B A
正しいのは: A B C
問題のコードは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res/m2uMobileSales.Droid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res/m2uMobileSales.Droid"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:showDividers="none"
android:layout_weight="1">
<include
layout="@layout/PageCommon_Titlebar" />
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/tableLayout1"
android:divider="@null"
android:dividerHeight="0dp"
android:stretchColumns="1">
<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/tableLayout1"
android:stretchColumns="1">
<!--Customer Name-->
<TextView
android:id="@+id/CustomerName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="30dp"
android:layout_weight="1"
local:MvxBind="{'Text':{'Path':'Customer.CustDetails.Name','Mode':'OneWay'}}" />
</TableRow>
<TableRow>
<!--Detail Pages android:padding="12dp" -->
<Mvx.MvxBindableLinearLayout
android:padding="3dip"
android:id="@+id/ClienteDetails"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="@null"
android:dividerHeight="0dp"
android:orientation="vertical"
android:cacheColorHint="#00000000"
android:layout_weight="1"
local:MvxItemTemplate="@layout/listitem_clientdetailpages"
local:MvxBind="{'ItemsSource':{'Path':'DetailPageViewModels'}}"/>
<!--<Mvx.MvxBindableListView
android:id="@+id/ClienteDetails"
android:divider="@null"
android:dividerHeight="0dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:cacheColorHint="#00000000"
android:layout_weight="1"
local:MvxItemTemplate="@layout/listitem_clientdetailpages"
local:MvxBind="{'ItemsSource':{'Path':'DetailPageViewModels', 'Mode':'OneWay'}}" />-->
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
コメント付きの Mvx.MvxBindableListView を使用すると、最初のアイテムしか表示されません。目的は、android の定義のように、リストではなくすべての要素をスクロールすることです。この問題を克服した後、リスト内にリストを作成します (DetailPageViewModels にはリストを含むいくつかの要素があります)。
ScrollView 内にすべての要素を挿入することを勧める投稿をいくつか見ました。
コメントを試してみました Mvx.MvxBindableLinearLayout、ScrollView、MvxBindableListView はうまくいきました。ScrollView を使用すると、最初の要素しか表示されません。
私の目的は、ページ全体と非要素をスクロールする必要があるため、MvxBindableLinearLayout を使用することです。
listitem_clientdetailpages コード:
<?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/m2uMobileSales.Droid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:showDividers="none"
android:layout_weight="1">
<!--Page Title-->
<TextView
android:id="@+id/detailpagetitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="24dp"
android:padding="3dip"
local:MvxBind="{'Text':{'Path':'Title','Mode':'OneWay'}}" >
</TextView>
</LinearLayout>
混乱をお詫び申し上げます。
助けてくれてありがとう。