Action bar being shown below its tabs

前端 未结 3 1516
隐瞒了意图╮
隐瞒了意图╮ 2021-01-18 23:33

When i set these attributes:

    actionBar = getSupportActionBar();

    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowHomeEnabled(f         


        
3条回答
  •  花落未央
    2021-01-18 23:50

    I googled this problem and found this thread on gitub: https://github.com/JakeWharton/ActionBarSherlock/issues/327

    You can read the thread, but the conclusion is:

    Hi. Just found a simple workaround.

    Use the following in your onCreate method :
    View homeIcon = findViewById(android.R.id.home);
    ((View) homeIcon.getParent()).setVisibility(View.GONE);
    this collapses the home button completely.

    PS : i'm using standard ActionBar but this should work the same

    I hope this helps you out,
    Daniel.

提交回复
热议问题