ActionBarSherlock - Tabs appearing ABOVE actionbar with custom view

前端 未结 7 1889
春和景丽
春和景丽 2020-12-13 14:33

I Am trying to create an actionbar without the app logo/text, and with a centralised picture, and i know it is possible with a custom view, here is my code:

         


        
7条回答
  •  情书的邮戳
    2020-12-13 15:09

    I used this

    ActionBar ab = getSupportActionBar();
    ab.setDisplayShowHomeEnabled(true);
        ab.setDisplayHomeAsUpEnabled(false);
        ab.setHomeButtonEnabled(false);
        ab.setLogo(null);
    
        View homeIcon = findViewById(
                Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ? 
                android.R.id.home : R.id.abs__home);
        ((View) homeIcon.getParent()).setVisibility(View.GONE);
        ((View) homeIcon).setVisibility(View.GONE);
    
        ab.setDisplayShowTitleEnabled(false);
    

提交回复
热议问题