android XML下searchable.xml
16lz
2021-01-23
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中自定义播放器的实现
- android ctl属性的实现过程
- 整理:RelativeLayout的相关属性
- android ImageView android:adjustViewBounds属性的作用。
- Android 选择器 PickerView实例,时间选择器、地址选择器、单项选
- EditText的属性
- 自定义 SeekBar 样式 详解
- CoordinatorLayout使用自定义Behavior实现UC浏览器顶栏效果