Monday, December 22, 2008

Display icon next to radio button in Android

Here is how to display icons on RadioButton on Android
<RadioButton android:id="@+id/RadioButton01"
   android:layout_width="wrap_content" 
   android:layout_height="wrap_content" 
   android:text="Text"
   android:drawableLeft="@drawable/icon" 
   android:drawableRight="@drawable/icon" 
   android:drawableTop="@drawable/icon" 
   android:drawableBottom="@drawable/icon" />

Quick Explanation:
Here you shall see 4 locations where you can put the icons, mainly top, right, bottom and left. The names are android:drawableTop, android:drawableRight, android:drawableBottom and android:drawableLeft.
Hope it helps

Update History
   Jan 17, 2012 - Visual Update
Post a Comment