我试图在微调中设置提示在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) –