【发布时间】:2014-01-29 18:46:18
【问题描述】:
我在我的 Xamarin Android 应用程序中有一个使用 MvvmCross 的自定义微调器。我使用自定义的唯一原因是模型包含一个类,我希望微调器使用该类上的属性填充值。但是,下拉菜单的外观与我的应用程序的其他部分不同。它缺少右侧的单选按钮并且间距已关闭。如何让这个自定义微调器看起来和其他微调器一样?
<Mvx.MvxSpinner
style="@style/spinner_input"
local:MvxItemTemplate="@layout/item_spinner"
local:MvxDropDownItemTemplate="@layout/item_spinnerdropdown"
local:MvxBind="ItemsSource ProductCategoryOptions; SelectedItem SelectedProductCategory" />
Item_Spinner.axml - 这部分似乎刚刚好,一旦选择了一个值,下拉列表的外观看起来就像其他的一样。
<?xml version="1.0" encoding="utf-8"?>
<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.axml - 我认为这是错误的文件。下拉菜单的外观不匹配。
<?xml version="1.0" encoding="utf-8"?>
<CheckedTextView 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" />
【问题讨论】: