How to do add custom layout in NavigationView
and design my create custom NavigationView
use material design,i want put my drawer icon to right and text left of it something like this
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I Search too much and this is my experience that works fine
at first create layout for header. its name is
nav_header_main.xml
then put it inlayouts
folders inres
and put this code in it..then i include it as child of
NavigationView
and For menu item i useRecyclerView
to show menu and icon so myNavigationView
isjust you have to remember put your
NavigationView
inDrawerLayout
then i create layout for menu item with
ImageView
andTextView
this layout and this name iscard_drawer_item.xml
and its code is herethen i create
ViewHolder
folder for this layout.now i define text of menu items as string array and array that contains menu icons in menu in
strings.xml
then we just need an
Adapter
like thisevery thing is ok .. just now we have to set NavigationView in Activity.