美文网首页
textview的图片设置

textview的图片设置

作者: ben大福 | 来源:发表于2019-03-20 12:10 被阅读0次

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

api原文为:

Sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. Use null if you do not want a Drawable there. The Drawables’ bounds will be set to their intrinsic bounds.

设置drawable到textview的上下左右位置中去,图片大小就是drawable的intrinsic大小

setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom)

api原文为:

Sets the Drawables (if any) to appear to the left of, above, to the right of, and below the text. Use null if you do not want a Drawable there. The Drawables must already have had setBounds(Rect) called.

设置的drawable必须要先设置Bounds

setCompoundDrawablePadding(int pad)

api原味为:

Sets the size of the padding between the compound drawables and the text.

设置drawable和text的间距pandding

相关文章

网友评论

      本文标题:textview的图片设置

      本文链接:https://www.haomeiwen.com/subject/lzrzmqtx.html