How to remove pointed icon in Navigation Drawer, I just playing with Navigation Drawer, I just wanted to maintain only one icon and the title in center.
put this in your onCreate() method.
getActionBar().setIcon(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
Related
I'm using support.v7.widget.Toolbar for create my actionbar. My question is that how I can change default drawer menu icon position to right corner?
Use DrawerArrowDrawable set in menu replace Toolbar Navigation Icon!
I have implemented Navigation Drawer using NavigationView from design support library. I want to change the margins of nav drawer depending on the nav menu item selected. Basically I want that NavDrawer should always be below the toolbar and tabs, if present.
I tried below code to set the top margin but it doesn't work. No APP crash but drawer doesn't open when I click hamburger icon. Pls help SO community.
DrawerLayout.LayoutParams params = (DrawerLayout.LayoutParams)mNavigationView.getLayoutParams();
params.setMargins(0,72,0,0);
mNavigationView.setLayoutParams(params);
I use sliding drawer menu in my android project and
I use one drawer menu for all of myActivies
I want in root Activity when click on actionbar`s icon the drawer menu is open!
and in childs Activities when click on actionbar's icon go to parent Activity
like google play or gmail and ...
how I can do this?!
Implement the navigation as usual (with drawertoggle and everything), then call
_toggle.setDrawerIndicatorEnabled(false);
It will hide the drawer icon (the three vertical lines) and display the up caret. The up icon click event will not be handle by the drawer and will finish the activity (if you do so in the OnOptionsItemSelected).
yup, you can use Navigation drawer in the layout and as well as in the java code.
check this url for screenshot
https://developer.android.com/design/media/navigation_drawer_holo_dark_light.png
In my Android app, I show the actionbar and normally in the far left is my app's logo and to the left of the logo is the icon that lets you display the navigation drawer. This icon is typically 3 horizontally bars above each other.
After modifying my app, this menu icon is no longer visible. Instead, an arrow for "back" is now displayed.
I even have:
setDisplayHomeAsUpEnabled(false);
This gets rid of the arrow for navigating Up (or back) but the 3 bar menu item never shows. I still can press on my app's logo to the right and it will bring up the navigation drawer.
What is preventing the menu icon from showing?
I already have this problem and it was when I used a Fragment instead of an Activity. When you use an activity, you got the three lines to open the menu (if of course you enabled it), if you have a fragment, then you have an arrow.
I personnally use this :
ActionBarDrawerToggle mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
R.drawable.ic_drawer, //nav menu toggle icon
R.string.app_name, // nav drawer open - description for accessibility
R.string.app_name // nav drawer close - description for accessibility
)
Where the ic_drawer is the 3 bars icons. I use this tutorial to create my app Drawer.
Hopefully this can help you anyhow =)
How to remove pointed icon in Navigation Drawer, I just playing with Navigation Drawer, I just wanted to maintain only one icon.
I had same issue and I solved with adding this line in onCreate():
getActionBar().setDisplayHomeAsUpEnabled(false);
it will hide icon from navigation drawer.
Which implementation are you using for the Navigation Drawer?
Also, why do you want to remove it? You could keep the icon there and use an actual icon instead of one trying to show that it is a menu next to your "Home" text.
Is it a bit too late for answer?
1 way to remove the 3 stripes from the app is
replace the ic_drawer.png in every drawable folder with nothing (eg. with transparent icon)
You also can replace with any icon you want too.