【发布时间】:2013-04-05 02:12:00
【问题描述】:
我在我的应用程序中使用了 actiobarcompat 示例,并且我正在尝试实现对 3.0 之前的设备的搜索。
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_search"
android:orderInCategory="1"
android:title="@string/menu_search"
android:icon="@drawable/ic_home"
android:showAsAction="collapseActionView|ifRoom"
android:actionViewClass="android.widget.SearchView" />
</menu>
在 Honeycomb+ 上这工作正常,searchview 小部件出现在操作栏中。我想要做的是有第二个菜单 XML,所以我可以回退到旧的搜索活动方式。但是,没有 menu-v11 文件夹之类的东西,因为菜单文件夹本质上是 menu-v11,因为这是它开始支持的版本。
我的问题是,使用操作栏兼容性示例,有没有办法以声明方式为 pre-honeycomb 添加一个备用按钮?
【问题讨论】:
-
您考虑过使用 ActionBar Sherlock 吗?
-
我有..他们都是 Apache ......虽然它很复杂。我正在考虑西装是否允许我首先使用这些组件中的任何一个。这可能都是徒劳的。
-
@TomFobear:如果这就是您的意思,那么 ABS (ActionBarSherlock) 属于 Apache 许可证。如果这一切都取决于接受使用这种库的 suits,那么您应该将所有选项放在桌面上。如果他们需要该功能,他们将需要选择,我怀疑,很可能是 ABS。
-
使用 Apache 许可库有什么问题?许多商业应用程序使用 ActionBar Sherlock,例如 Foursquare。这不是 GPL。
标签: android android-actionbar android-3.0-honeycomb android-2.3-gingerbread android-actionbar-compat