我試圖在微調中設置提示在android中,通過動態添加數據在微調。首先,我用spinner.setPrompt(「分支列表」)但不能將其設置爲微調器。儘管我的這段代碼很爛。但仍然沒有完成。然後我用第二種方法如下:在Android中的微調提示在工作不起作用
我在這裏通過分享我的xml代碼,這是我用於設置提示的第二種方法。
MainActivity.xml
<Spinner
android:layout_width="250dp"
android:layout_height="wrap_content"
android:id="@+id/branchSpinner"
android:spinnerMode="dropdown"
android:prompt="@string/Branch"
/>
Stings.xml
<string name="Branch">Branch</string>
問題是slimier爲[https://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one](https:// stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one) –