android上的自定义按钮样式

时间:2016-07-24 00:56:26

标签: android

我正在使用以下链接创建自定义按钮。我跟着每一步。 https://androidcookbook.com/Recipe.seam?recipeId=3307

然后我按照以下方式创建了一个按钮:

   <Button
    android:id="@+id/btnButton1"
    android:layout_width="95dp"
    android:layout_height="wrap_content"
    android:buttonStyle="@style/button"
    android:text="CREATE"
    android:onClick="createButtonClickHandler"/>

但我看到我的按钮有默认样式。我希望我的按钮有这种新的花哨定制风格。

1 个答案:

答案 0 :(得分:1)

请勿使用(1..4).to_a #=> [1, 2, 3, 4] (1..2).to_a #=> [1, 2] ,只使用buttonStyle

style

参考:https://developer.android.com/guide/topics/ui/themes.html

相关问题