AndroidでTextViewを動的に切り替える方法まとめ

AndroidでTextViewを動的に切り替える方法まとめ

tyy

例1右方向画像の設定方法
Drawable drawable = getResources().getDrawable(R.drawable.hotel_search);
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
selectCityTv.setCompoundDrawables(null, null, drawable, null);

例2

selectCityTv.setCompoundDrawablesWithIntrinsicBounds( Drawable left, Drawable top,Drawable right,Drawable bottom)

Android

Posted by arkgame