navigation drawer - How to put counter on NavigationView from Android Design Library? -
i see tutorial making navigation drawer using design library here. creating navigation drawer lot easier. but, many tutorial on internet show list of item image on left. if want put counter next item title? next followers , badges in following image. or need use old way make navigation drawer (using layout insteand of xml menu)?
in new navigationdrawer have not mention counter lookig for. can avoid older way put counter.
because navigation can contain child view can use this.
<android.support.design.widget.navigationview android:id="@+id/navview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start"> <listview android:entries="@array/test" android:id="@+id/lvdata" android:layout_width="match_parent" android:layout_height="match_parent"/> </android.support.design.widget.navigationview>
so reference listview , give customize layout want.
i know older way of listview. reduce code of navigationdrawer. hope helps you.
note : never use app:menu , child view in navigationview @ same time. otherwise overlap each other.
Comments
Post a Comment