无法获得Android 4.0的拆分操作栏工作 [英] Can't get the Android 4.0 Split Action Bar working

查看:88
本文介绍了无法获得Android 4.0的拆分操作栏工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照在Android开发网站开发页面,但我不能让我的动作条分割屏幕的顶部和底部。

I've followed the development pages on the android dev site, but I cannot get my action bar to split to the top and bottom of the screen.

我有一对夫妇的选项中定义的菜单XML:

I've got a menu xml defined with a couple of options:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:id="@+id/stop_services"
    android:icon="@drawable/ic_launcher"
    android:title="@string/stop" 
    android:showAsAction="ifRoom|withText"/>
  <item android:id="@+id/start_services"
    android:icon="@drawable/pushpin"
    android:title="@string/start" 
    android:showAsAction="ifRoom|withText"/>
</menu>

在我的表现我已经设置了uiOption为:

In my manifest I've set the uiOption to:

<activity
  android:label="@string/app_name"
  android:name=".ProxilenceHome" 
  uiOptions="splitActionBarWhenNarrow" >

我加载活动中的菜单项如下:

I load the menu items in the activity as follows:

public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.home_menu, menu);
    return true;
}

不过,测试应用程序时,操作栏永远不会分裂。有谁知道这个问题/如果我错过了什么了?

But when testing the application, the action bar never splits. Does anyone know the problem/ if I've missed anything out?

多谢了。

推荐答案

使用机器人:uiOptions =splitActionBarWhenNarrow对我的作品

如果没有机器人:这是行不通的。

Without the "android:" it does not work

这篇关于无法获得Android 4.0的拆分操作栏工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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