Add A Textview To The Elements Of A Toolbar
I have made a material design toolbar. The menu item includes a cart. I want a number to be shown along with the cart icon indicating the number of items present in the cart. toolb
Solution 1:
First, please learn how to create your own customized toolbar.
Search for topics like this: http://code.tutsplus.com/tutorials/getting-started-with-android-creating-a-customized-toolbar--cms-24223
Then you can create your toolbar as below ;-)
Here is an example of your wannabe toolbar
<ImageViewandroid:id="@+id/shopping_bag"android:layout_width="44dp"android:layout_height="44dp"android:src="@drawable/bag"android:layout_alignParentLeft="true"android:layout_centerInParent="true"></ImageView><ImageViewandroid:id="@+id/arrow"android:layout_width="48dp"android:layout_height="wrap_content"android:src="@drawable/usability_bidirectionality_guidelines_when3"android:layout_alignParentRight="true"></ImageView><ImageViewandroid:id="@+id/number"android:layout_width="20dp"android:layout_height="20dp"android:src="@drawable/one"android:layout_alignTop="@+id/shopping_bag"android:layout_alignRight="@+id/shopping_bag"/></RelativeLayout>
and it looks like:
To have a better look, find Material Design inspired icons.
Hope it help
Post a Comment for "Add A Textview To The Elements Of A Toolbar"