我试图创建一个按钮,其文字颜色为colorAccent
,其背景色为默认背景色。带默认背景的材质凸起按钮
我已经试过默认样式,但他们的非工作过。目前,我有这样的事情,但不工作:
styles.xml
:
<style name="AppTheme.ButtonRaised" parent="Widget.AppCompat.Button.Colored">
<item name="colorButtonNormal">@android:color/transparent</item>
<item name="android:textColor">@color/colorAccent</item>
</style>
和布局:
<Button
app:theme="@style/AppTheme.ButtonRaised"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="date" />
而且我得到的东西是这样的:
我没有得到任何风格或主题的影响这里。我也试过用style
标签,但它不起作用。
你能解释一下为什么吗? – kirtan403
它工作吗? @ kirtan403 – Nilabja
等一下,我会检查 – kirtan403