android.widget.SearchView在style.xml中定义的属性未更新
创始人
2024-08-20 05:30:05
0
  1. 确保在style.xml中定义了SearchView的属性并按照语法正确使用。 例如,以下示例定义了SearchView的背景色为蓝色:



  1. 在SearchView的布局文件中指定style属性为上面定义的SearchTheme:

  1. 在代码中获取SearchView实例并使用setSearchableInfo()方法设置SearchableInfo属性,例如:
// In onCreate() method
SearchView searchView = findViewById(R.id.search_view);

// Get the SearchableInfo object
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchableInfo searchableInfo = searchManager.getSearchableInfo(getComponentName());

// Set the SearchableInfo to the SearchView
searchView.setSearchableInfo(searchableInfo);

这样可以确保SearchView正常工作并在style.xml中定义的属性得到更新。

相关内容

热门资讯

透视烘培!德普之星辅助软件,德... 透视烘培!德普之星辅助软件,德普之星的辅助工具介绍(透视)本来真的是有脚本神器(哔哩哔哩)1、完成德...
透视讲义!wepoker俱乐部... 透视讲义!wepoker俱乐部辅助器,hhpoker作必弊码(透视)真是有挂(哔哩哔哩)1、很好的工...
透视妙招!hhpoker软件可... 透视妙招!hhpoker软件可以玩吗,hhpoker德州透视(透视)确实是有脚本方法(哔哩哔哩)1、...
透视绝活儿!wepoker究竟... 透视绝活儿!wepoker究竟有没有透视,pokemomo辅助软件(透视)竟然是有挂(哔哩哔哩)1、...
透视指引!wepokerplu... 透视指引!wepokerplus到底是挂了吗,德州透视是真的吗(透视)其实真的有挂(哔哩哔哩)1、操...
透视烘培!德州之星扫描器,so... 透视烘培!德州之星扫描器,sohoo辅助(透视)好像存在有透视软件(哔哩哔哩)德州之星扫描器透视方法...
透视教材!hhpoker怎么防... 透视教材!hhpoker怎么防作必弊,hhpoker可以开挂吗(透视)本来有挂(哔哩哔哩)hhpok...
透视妙招!aapoker插件下... 透视妙招!aapoker插件下载,aapoker辅助软件合法吗(透视)原来存在有透视插件(哔哩哔哩)...
透视指南书!竞技联盟破解版最新... 透视指南书!竞技联盟破解版最新版,德普之星透视辅助插件(透视)原来真的是有挂(哔哩哔哩)德普之星透视...
透视妙计!德普辅助软件,德普之... 透视妙计!德普辅助软件,德普之星透视(透视)确实存在有透视工具(哔哩哔哩)1、德普之星透视透视辅助软...