【发布时间】:2011-04-16 02:11:42
【问题描述】:
我在为按钮定义的样式中使用了属性layout_marginLeft="30dip"。当我为每个按钮单独应用此样式时,左边距会按我的意愿放置。
然后我定义了一个主题,我将按钮样式分配给属性android:buttonStyle 并将其应用于我的项目。
但是,左边距属性被忽略。知道我必须在这里做什么吗?
style.xml如下:
<style name="btnstyle" parent="@android:style/Widget.Button">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_marginLeft">30dip</item>
<item name="android:textColor">#FFFFFF</item>
</style>
<style name="appstyle" parent="android:Theme">
<item name="android:buttonStyle">@style/btnstyle</item>
</style>
【问题讨论】:
标签: android button coding-style themes margins