I can't split action bar in android

可紊 提交于 2019-12-25 05:13:57

问题


The action bar works, but I don't know why i can't split it in my app.. There's two activities, the splash screen comes first..,I don't know what's missing.. here's my manifest code:

<?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>

Any help would be much appreciated!

Thank you very much!


回答1:


recommend that use HoloEveryWhere:

Library

Blog

See the tutorials, download the demo, and good luck




回答2:


As the ui option name (splitActionBarWhenNarrow), the split action bar only is used on narrow screens, such as phones in portrait mode as explained in the guide for supporting both tablets and phones. For tablets (and even phones in landscape), the split action bar is not used as there is enough room in the action bar for the icons.



来源:https://stackoverflow.com/questions/25749662/i-cant-split-action-bar-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!