Android的splitActionBarWhenNarrow不姜饼利用AppCompat时,工作 [英] Android's splitActionBarWhenNarrow doesn't work in Gingerbread when using AppCompat

查看:332
本文介绍了Android的splitActionBarWhenNarrow不姜饼利用AppCompat时,工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的的Andr​​oidManifest.xml 文件有一个活动,看起来是这样的:

My AndroidManifest.xml file has an Activity that looks like this:

<activity
    android:label="@string/log_in"
    android:name=".activities.LogInActivity"
    android:parentActivityName=".activities.MainActivity"
    android:uiOptions="splitActionBarWhenNarrow">
    <meta-data
        android:name="android.support.PARENT_ACTIVITY"
        android:value=".activities.MainActivity" />
</activity>

不过可惜的是但是,拆分操作栏似乎并不适用于运行的Andr​​oid版本低于蜂窝(API 11)的设备。相反,菜单项都出现在顶部操作栏,然后溢流​​进入菜单,而不是分裂下面的动作吧。

But unfortunately however, the split action bar doesn't seem to work on any device running a version of Android below Honeycomb (API 11). Instead, the menu items all appear on the top action bar and then overflow into the menu instead of splitting to the action bar below.

怎么办?

推荐答案

我是非常接近的,只是需要一点点更多的XML来解决该问题:

I was very close and just needed a tiny bit more XML to fix the issue:

<meta-data
    android:name="android.support.UI_OPTIONS"
    android:value="splitActionBarWhenNarrow" />

所以,现在的XML将成为这样的:

So now the XML would become this:

<activity
    android:label="@string/log_in"
    android:name=".activities.LogInActivity"
    android:parentActivityName=".activities.MainActivity"
    android:uiOptions="splitActionBarWhenNarrow">
    <meta-data
        android:name="android.support.PARENT_ACTIVITY"
        android:value=".activities.MainActivity" />
    <meta-data
        android:name="android.support.UI_OPTIONS"
        android:value="splitActionBarWhenNarrow" />
</activity>

这篇关于Android的splitActionBarWhenNarrow不姜饼利用AppCompat时,工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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