我想显示ListView
来自这样的SearchView
请求的项目结果:
我不想使用ActionbarSherlock,也找不到任何教程。
使用自定义的建议菜单中的XML的动作条
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/app_label"
android:hint="@string/search_hint"
android:searchSuggestAuthority="com.example.MyCustomSuggestionProvider">
</searchable>
或在布局中创建autocompletetextview并添加Layout Inflator并设置setCustom
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowCustomEnabled(true);
LayoutInflater inflator = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflator.inflate(R.layout.yourlayout, null);
actionBar.setCustomView(v);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句