[英]Keyboard automatically pops up when clicking searchable spinner
我正在使用 miteshpithadiya 的可搜索微調器,GitHub 鏈接是
https://github.com/miteshpithadiya/SearchableSpinner
微調器效果很好,但是當單擊微調器時軟鍵盤會不斷彈出。 我想一直在尋找解決方案,但沒有找到任何解決方案
我曾嘗試使用觸摸事件,但帽子只刪除了可搜索微調器功能並保留了默認微調器
請推薦解決方案或其他可搜索的微調器
謝謝
你可以試試這個:
this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
但是鍵盤仍然出現在點擊微調器然后使用另一個可搜索微調器可能會很好我使用了這個並且它無縫地工作
implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
添加此樣式 -
<style name="Theme.UserDialog" parent="@style/Theme.AppCompat.Dialog">
<item name="windowActionBar">false</item>
<item name="android:textColor">@android:color/black</item>
<item name="android:background">@android:color/white</item>
<item name="android:windowBackground">@android:color/white</item>
<item name="android:itemBackground">@android:color/white</item>
<item name="android:tint">@android:color/black</item>
<item name="textColorAlertDialogListItem">@android:color/black</item>
<item name="android:editTextColor">@android:color/black</item>
<item name="android:focusable">false</item>
</style>
添加您的微調器 xml 部分。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.