[英]Hide 3-dot menu item when the Navigationbar appears
I want to hide the three-dot menu item when the navigationbar appears. 我想在导航栏出现时隐藏三点菜单项。
I found some nice topics how to hide the three-dot menu item: 我发现了一些不错的主题,如何隐藏三点菜单项:
How to disable/hide three-dot indicator(Option menu indicator) on ICS handsets 如何在ICS手机上禁用/隐藏三点指示器(选项菜单指示器)
How do I hide a menu item in the actionbar? 如何在操作栏中隐藏菜单项?
But I can not find a solution for my problem. 但是我找不到我的问题的解决方案。 I hope for some help. 希望能有所帮助。 :) :)
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
infoDialogFragment.aboutMenuItem(this);
return false;
}
@Override
protected void onPostCreate(@Nullable Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
actionBarDrawerToggle.syncState();
}
private void setNavigationDrawer() {
navigationView.setNavigationItemSelectedListener(menuItem -> {
});
return false;
}
Delete all of this codes from your activity: 从您的活动中删除所有这些代码:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
infoDialogFragment.aboutMenuItem(this);
return false;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.