[英]android - how to put imageview on top of textview letter?
只需使用android:drawableTop="@drawable/YOUR_DRAWABLE"
简单即可。
要设置运行时,请使用代码-
imgView.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.imgSrc, 0, 0);
如果不想添加,请在此处(0,R.drawable.imgSrc,0,0)左上右下0。
在您的XML上使用它
android:drawableTop="@drawable/your_image"
android:drawablePadding="10dp"
或在您的活动课上
textView.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.your_image, 0, 0);
textView.setCompoundDrawablePadding(10);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.