drawable - cart with custom icon with number text android -


i have cart icon looks customized, want show number in white space of icon alignment attribute should use ?

i tried padding double digit number looks ugly

<textview android:id="@+id/btn_cart"           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:visibility="gone"           android:background="@drawable/shopp_cart"           android:textcolor="@android:color/black"                  android:gravity="right|bottom"           android:paddingright="5dp"           android:paddingtop="20dp"           android:layout_centervertical="true"           android:layout_alignparentright="true"           android:layout_marginright="5dp"/> 

this custom icon enter image description here

use this. you. use 1 image view , 1 text view show icon , text

here code

<relativelayout     android:layout_width="match_parent"     android:layout_height="match_parent" >      <imageview         android:id="@+id/imageview1"         android:layout_width="48dp"         android:layout_height="48dp"         android:src="@drawable/ic_launcher" />      <textview         android:id="@+id/textview1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_marginleft="30dp"         android:layout_margintop="30dp"         android:background="#ffffff"         android:gravity="right"         android:paddingleft="4dp"         android:paddingright="4dp"         android:text="0"         android:textsize="17dp" /> </relativelayout> 

your icon this

enter image description here


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -