我有一個自定義綁定MvxSpinner,它與我的Android和iOS應用程序共享的ViewModel非常適合。在Android API Level 15(4.0.3)以上,一切看起來都很棒,但在Android API Level 14(4.0)上,微調框顯示每個ListItem元素的空白文本。 ListItems在那裏,但文本只是空白。當我在Android 4.0上進行選擇時,正確的值將傳遞迴所選項目的ViewModel,並且我的應用程序會相應更新。Android 4.0上的MvxSpinner Blank僅限
Android 4.0上是否有任何已知的MxvSpinner錯誤?
下面是我的MvxSpinner的XML:
<MvxSpinner
style="@style/spinner_input"
local:MvxItemTemplate="@layout/item_spinner"
local:MvxDropDownItemTemplate="@layout/item_spinnerdropdown"
local:MvxBind="ItemsSource ProductCategoryOptions; SelectedItem SelectedProductCategory" />
這裏是我的模板:
item_spinner
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/black"
android:text="Test"
local:MvxBind="Text Caption" />
Item_SpinnerDropDown
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
style="?android:attr/spinnerDropDownItemStyle"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxBind="Text Caption" />
感謝您的參考。我在各種設備/模擬器中獲得不一致的結果。如果我使用Xamarin進行構建並在模擬器中進行調試,則文本將顯示在下拉菜單中,但如果通過TestFlight構建和部署,則不會顯示文本。如果它可以被調試,那麼它就不會那麼糟糕,並且對於只有一個版本的Android使用特定的部署方案而言並不是一個問題。 如果我發現它與控件有關的任何問題,我會在這裏回覆。 – jdubbish