2013-10-10 100 views

回答

0

可以在XML的ImageView

android:scaleType="fitCenter" android:adjustViewBounds="true" 

做到这一点的代码,也可以使用通过这样的程序

imageview.setAdjustViewBounds(true); 
imageview.setScaleType(ScaleType.FIT_XY); 
+0

它只是延伸的形象。我的背部图像是11x11 png圆角。 5px圆+ 1px线+ 5px圆(从左到右,同样的东西从上到下)。当我使用stretchableImageWithLeftCapWidth:6 topCapHeight:6时,它伸展正好6.px,然后它将右上角/右下角的右上角/右下角对齐。 – fulberto100

相关问题