我有一个 Spinner:
<Spinner
android:id="@+id/test"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" />
它位于显示为对话框的 Activity 内(我不知道这是否重要,但是......)<activity android:theme="@android:style/Theme.Holo.Light.Dialog" ... />
它工作正常,显示所有五个项目。
直到键盘我打开键盘。现在,第一个项目已被剪切并且无法滚动到它。
我尝试在此微调器中放置一个单击监听器并关闭键盘,但出现错误 java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead
此行为的解决方法是什么?
最佳答案
您可能需要更改 list 文件中 Activity 的软输入模式。像这样的事情:
<activity android:windowSoftInputMode="adjustResize" ... >
关于android - 显示键盘时微调器会切断下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20362351/