android XML下searchable.xml
16lz
2021-12-04
1: <?xml version="1.0" encoding="utf-8"?> 2: <searchable xmlns:android="http://schemas.android.com/apk/res/android" 3: android:label="@string/search_label" 4: android:hint="@string/search_hint" 5: android:searchSettingsDescription="@string/search_settings_description" 6: android:searchSuggestAuthority="searchprovider" 7: android:searchSuggestIntentAction="android.intent.action.SEARCH" 8: android:searchSuggestThreshold="1" 9: android:includeInGlobalSearch="true" 10: android:searchSuggestSelection=" ?" 11: > 12: </searchable>
参数说明: android:searchSuggestAuthorith 此属性的值就是SearchSuggestAuthorith中的AUTHORITH了。 android:searchSuggestIntentAction 此属性定义了当我们选中搜索提示的内容时发生的目的动作。 android:searchSuggestThreshold 此属性定义了至少输入几个字符时才会弹出提示 android:includeInGlobalSearch 是否将内容加入android的全局搜索。true,加入。 android:searchSuggestSelection 定义搜索时参数的占位符 PS:配置参数不止这些,可以自己看看android的参考手册。 3.配置AndroidManifest.xml
1: <provider android:name=".SearchSuggestionsProvider" android:authorities="searchprovider" />注意authorities的属性值哦。o(∩_∩)o
更多相关文章
- Android(安卓)xml资源文件中@、@android:type、@*、?、@+含义和区
- Android(安卓)自定义View(手写签名)
- Android(安卓)xml资源文件中@、@android:type、@*、?、@+含义和区
- Android(安卓)Makefile中是 如何识别 TARGET_PRODUCT 的
- 修改EditText的光标颜色
- Android(安卓)layout xml总结
- android中自定义播放器的实现
- Android(安卓)在xml布局配置文件中给Button按钮添加事件
- textview设置文本每行的行间距