我在設計活動時遇到問題。MvxBindableLinearLayout ItemsSource綁定問題
我試圖使用Mvx.MvxBindableLinearLayout,使綁定到列表: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.MvxBind ableListView,我只能看到第一個項目。 目標是滾動所有的元素,而不是列表,作爲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>
我的困惑表示歉意。
感謝您的幫助和可用性。
更新增加 - 請嘗試在現有樣本中重現您的問題 - 例如在教程 – Stuart 2013-04-11 10:55:11