简体   繁体   English

ActionBar Sherlock顶部显示为空

[英]ActionBar Sherlock showing empty at top

I'm using ActionBarSherlock library in my project and everything was working fine until I tried to get my action bar only at the bottom of the screen and remove it from the top of the screen. 我在项目中使用ActionBarSherlock库,并且一切正常,直到我尝试仅在屏幕底部获取操作栏并将其从屏幕顶部删除。 What I want to have is the action bar only displayed at bottom. 我想要的是仅显示在底部的操作栏。

After removing the upper part, this is what I am getting: 除去上部之后,这就是我得到的:

应用以下代码后的结果

My code for the OnCreate method is: 我的OnCreate方法代码是:

    @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getSupportActionBar().setDisplayShowHomeEnabled(false);
        getSupportActionBar().setDisplayShowTitleEnabled(false);

    mSherlock
            .setUiOptions(ActivityInfo.UIOPTION_SPLIT_ACTION_BAR_WHEN_NARROW);

    requestWindowFeature(com.actionbarsherlock.view.Window.FEATURE_INDETERMINATE_PROGRESS);

    setContentView(R.layout.activity_main);

    //my stuff
}

And my Activity in the manifest is: 我在清单中的活动是:

        <activity
        android:name="com.apps.MainActivity"
        android:label="@string/title_activity_main" 
        android:uiOptions="splitActionBarWhenNarrow">

So I want to know what I may be doing wrong. 所以我想知道我可能在做错什么。 Thanks in advance guys! 在此先感谢大家!

you can the following code in manifest file to display icon on the top of action bar 您可以在清单文件中执行以下代码,以在操作栏顶部显示图标

android:icon="@drawable/youriconimage" this sets your application icon and if you want to add logo on the tab of action bar use
android:logo="@drawable/yourlogoimage"

hope it will help you. 希望对您有帮助。

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

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