How to customize Android ActionBar to show a custom view before the tabs?

后端 未结 7 1957
孤街浪徒
孤街浪徒 2020-12-29 19:48

I\'m using a custom view for the ActionBar with Tabs. My problem is the ordering of the custom view. Android is displaying it AFTER the tabs - which I do no

相关标签:
7条回答
  • 2020-12-29 20:29

    First set "DisplayShowHomeEnabled" property of actionbar to "true": actionBar.setDisplayShowHomeEnabled(true);

    and then:

        View homeIcon = findViewById(android.R.id.home);
            ((View) homeIcon.getParent()).setVisibility(View.GONE);
            ((View) homeIcon).setVisibility(View.GONE);
    

    I hope it helps :)

    0 讨论(0)
提交回复
热议问题