Sep 28, 2012

TextView 왼쪽 아이콘

android:drawableLeft="@drawable/ic_launcher"

or

TextView tv; 
Drawable icon; 


Bitmap b = Bitmap.createScaledBitmap(((BitmapDrawable) icon).getBitmap(), 120, 120, false);
icon = new BitmapDrawable(b); 
icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());

tv.setTextSize(12); 
tv.setGravity(Gravity.CENTER); 
tv.setCompoundDrawables(icon, null, null, null);

No comments:

Post a Comment