Android actionbar not visible

后端 未结 17 2224
萌比男神i
萌比男神i 2020-12-18 18:23

I am trying to add an option menu in actionbar to my existing app but it is not working. If I create a new project with \"hello world\" default app I can see the button in a

17条回答
  •  無奈伤痛
    2020-12-18 18:43

    on create of your activity.

    getSupportActionBar().setDisplayShowCustomEnabled(true);
            getSupportActionBar().setDisplayShowHomeEnabled(false);
            customNav = LayoutInflater.from(this).inflate(
                    R.layout.action_bar_customvieew, null);
            getSupportActionBar().setCustomView(customNav);
    

提交回复
热议问题