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)?

enter image description here

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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -