ActionBarSherlock - Tabs appearing ABOVE actionbar with custom view

前端 未结 7 1878
春和景丽
春和景丽 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:29

    Following @furyfred answer, this code can be used when using the ActionBar from AppCompat library:

    View homeIcon = findViewById(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB ?
                android.R.id.home : android.support.v7.appcompat.R.id.home);
    
    if (null != homeIcon && null != homeIcon.getParent())
    {
        ((View) homeIcon.getParent()).setVisibility(View.GONE);
    }
    
    0 讨论(0)
提交回复
热议问题