android - ImageView: Drawable and padding? -
i wrote custom drawable , display in imageview.
if add padding imageview, drawable overdraw padding , fills complete image view.
what in drawable is:
@override public void setbounds(int left, int top, int right, int bottom) { super.setbounds(left, top, right, bottom); rect r = new rect(); getpadding(r); log.d("test", "padding " + r.toshortstring()); mwidth = right - left; mheight = bottom - top; }
and in drawables draw method draw bitmap fill mwidth , mheight.
so how take padding count? getpadding(r); returns 0,0,0,0 values if imageview has padding.
any idea how fix that?
getpadding() can called after imageview has been loaded. add viewtreeobserver padding after imageview has been loaded.
Comments
Post a Comment