android – 将我的ActionBar放在底部

我按照教程在我的应用程序中获取动作栏.但即使我在我的Manifest文件中放置了 android:uiOptions =“splitActionBarWhenNarrow”,它仍然保持在顶部.任何人对如何处理此代码有任何想法?

XML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" 
android:orientation="vertical"
android:background="#f0f0f0" 
android:baselineAligned="false">

<LinearLayout 
    android:id="@+id/myFragments"
    android:layout_width="match_parent"
    android:layout_height="0dp">

</LinearLayout>

</LinearLayout>

清单文件:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.alotoftesting"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="15" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" 
        android:uiOptions="splitActionBarWhenNarrow">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

</manifest>

解决方法

谷歌默认操作栏在任何情况下都不会显示在底部.正如其他人提到的那样,当设备很窄时,splitActionBarWhenNarrow只会在屏幕底部放置一个ActionBar的子集(如制表符等).不幸的是,如果你想在屏幕底部实现类似ActionBar的接口,你必须自己实现它( a quick search finds this example),因为我还没有看到任何库为你做这件事.

总而言之,我建议反对它,因为它违反了设计文档中的Seamlessness design principle,打破了用户对ActionBar类型控件所在位置的期望 – 一个Android用户理想地习惯于以某种方式做事,你需要一个非常令人信服的理由打破这种期望.

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...