对于搜索查看最好的选择为Android API级别7吗? [英] Best alternative for SearchView for Android api level 7 and up?

查看:122
本文介绍了对于搜索查看最好的选择为Android API级别7吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建我的应用程序为4.0+版本,现在增加了在Android API级别7 +运行设备的支持。

I have created my app for version 4.0+ and now adding support for devices running on Android api level 7+.

我添加了操作栏和类似的组件ActionBarSherlock;所以我已经解决了与很多问题。但是,我无法找到搜索查看组件的方式。我应该创建具有编辑框自定义视图,并呼吁它只是设备不具备搜索查看?

I have added ActionBarSherlock for action bar and similar components; so I've solved many problems with that. However, I couldn't find a way for SearchView component. Should I create a custom view which has edit box and call it only devices which don't have SearchView?

你怎么解决这个问题呢?

How do you solve this problem?

推荐答案

由于您使用actionBarSherlock,你可以使用SearchViewCompat。

since you use actionBarSherlock, you can use SearchViewCompat .

您还可以检查出,我已经创造了这个帖子

如果你想自定义它看起来多的Andr​​oid版本的方式,你可以在你很可能会使用EDITTEXT使用addTextChangedListener。

if you wish to customize the way it looks on multiple android versions, you can use addTextChangedListener on the editText that you will probably use.

这篇关于对于搜索查看最好的选择为Android API级别7吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆