当您设置android:background
为另一种颜色时,Button
显得更大。同样,围绕的线条Button
也消失了。为什么是这样?
设置颜色时,它会以此颜色绘制矩形区域,但默认情况下,它可以使用一些可绘制的图像或九个补丁图像。使用形状自定义背景或覆盖样式。如果只需要对某些视图应用样式,则可以使用xml属性style
。
<style name="MyCoolStyle" parent="base style of view" >
</style>
在布局xml中:
<YourView
style="@style/MyCoolStyle"/>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句