简体   繁体   English

如何显示拆分操作栏

[英]how to display split action bar

In the android document they said to use split actionbar, 他们在android 文档中说要使用拆分操作栏,

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

this what I did , but its not displaying 这是我所做的,但未显示

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.i.www.i" >
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/CustomActionBarTheme" >
        <activity android:uiOptions="splitActionBarWhenNarrow"
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        </activity>
    </application>

</manifest>

how to fix it 如何解决

The split action bar pattern was discontinued with Android 5.0's Theme.Material and recent editions of appcompat-v7 . 拆分操作栏模式已在Android 5.0的Theme.Materialappcompat-v7最新版本中appcompat-v7

You are welcome to create your own Toolbar and place it at the bottom of your layout, as a split action bar replacement. 欢迎您创建自己的Toolbar ,并将其放置在布局的底部,作为拆分操作栏的替代品。 This sample project has an appcompat-v7 version of that approach, while this sample project has a sample that uses the native API Level 21 edition of the Toolbar . 该示例项目具有该方法的appcompat-v7版本,而该示例项目具有使用Toolbar的本机API Level 21版本的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM