我正在使用MvxSpinner并且只想在spinner上显示下拉选定值。目前它显示下拉列表中的第一项但我想显示空白,因为我没有从下拉列表中选择任何值。
微调
<MvvmCross.Binding.Droid.Views.MvxSpinner
android:id="@+id/mySpinner"
android:layout_width="match_parent"
android:layout_height="match_parent"
local:MvxDropDownItemTemplate="@layout/myspinner_item"
local:MvxItemTemplate="@layout/myspinner_item"
android:layout_marginLeft="0dp"
android:dropDownWidth="257dp"
android:dropDownSelector="@drawable/list_item_selector"
android:layout_centerInParent="true"
android:spinnerMode="dropdown"
local:MvxBind="ItemsSource MyItems; HandleItemSelected SelectCommand" />
myspinner_item
<?xml version="1.0" encoding="utf-8"?>
<MvvmCross.Binding.Droid.Views.MvxLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_item_selector"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="32dp"
android:textSize="15sp"
android:textColor="#de000000"
android:lineSpacingExtra="5sp"
android:singleLine="true"
android:text=""
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:layout_marginLeft="24dp"
local:MvxBind="Text Description; Typeface StringToFont('Effra_Rg')" />
</MvvmCross.Binding.Droid.Views.MvxLinearLayout>