我有这个按钮Android的 - 按钮的背景颜色缩小按钮的高度
<Button
android:id="@+id/learn"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop ="5dp"
android:text="Hello StackOverflow"
style="@style/home_page_buttons"
/>
,我试图给它这种风格
<style name="home_page_buttons">
<item name="android:layout_marginLeft">15dp</item>
<item name="android:layout_marginRight">15dp</item>
<item name="android:textColor">@color/light_best_blue</item>
<item name="android:textStyle">bold</item>
<item name="android:color">@color/white</item>
<item name="android:background">@color/white</item>
</style>
这条线:
<item name="android:background">@color/white</item>
使背景变成了我想要的白色,但由于某种原因,它缩小了按钮的高度并使其变得难看。
任何想法为什么发生这种情况,以及如何制止这种副作用?
谢谢!
你的意思是把这个XML在通常我会有图像的目录? – Genadinik 2012-07-24 16:45:16
是的,我把我的地图放入drawable中,然后按钮背景的backgoundColor =“@ drawable/yourfile” – 2012-07-24 17:08:25