安卓Android Studio Button按钮background不生效无效问题

今天又是无语的一天。。。。。。
在学习安卓按钮这部分的时候,我新建了xml资源文件用来专门配置按钮的样式:


    

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">


<solid android:color="#009688" />
    <size android:height="50dp"
        android:width="50dp" />

shape>

按钮那块代码:

        <Button
            android:id="@+id/btnOnIncome"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/button_home_income"
            android:background="@drawable/home_round_button">
        Button>

想象中的按钮样式如图;
安卓Android Studio Button按钮background不生效无效问题_第1张图片
但是总是显示默认的蓝紫色;百思不得解!!!
搞了两个小时…
一开始把button标签换成了viewbutton样式是有了但是字不好弄;
后来才找到原因:

在res/values/themes.xml 中:

    <style name="Theme.Bookkeeping" parent="Theme.MaterialComponents.DayNight.DarkActionBar">

把后面的parent修改为:

<style name="Theme.Bookkeeping" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge" >

@#%#%#¥#%%¥¥%#%¥%%

哪位大佬能帮忙解答下到底是什么个意思!

你可能感兴趣的:(android,android,studio)