我无法拆分android中的动作栏

时间:2014-09-09 16:26:50

标签: android android-actionbar

操作栏有效,但我不知道为什么我不能在我的应用程序中拆分它。有两个活动,首先是启动画面..,我不知道缺少什么..这是我的清单代码:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="example.paint"
    android:versionCode="1"
    android:versionName="1.0" >

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true" />

    <uses-sdk android:minSdkVersion="14"  />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>


    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name">
        <activity
            android:name=".Splash"
            android:label="@string/app_name"
            android:exported="true"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>


        </activity>
        <activity
            android:name=".Paint"       
            android:configChanges="orientation|screenSize|keyboard|keyboardHidden"
            android:uiOptions="splitActionBarWhenNarrow">
            <intent-filter>

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


    <activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>



   </application>

</manifest>

任何帮助将不胜感激!

非常感谢!

2 个答案:

答案 0 :(得分:1)

建议使用HoloEveryWhere:

Library

Blog

查看教程,下载演示,祝你好运

答案 1 :(得分:0)

作为ui选项名称(splitActionBarWhenNarrow),分割操作栏仅用于窄屏幕,例如纵向模式下的电话,如the guide for supporting both tablets and phones中所述。对于平板电脑(甚至是风景中的手机),分割操作栏,因为图标的操作栏中有足够的空间。