gpt4 book ai didi

android - AppCompatButton 在 Android Marshmallow 上不显示

转载 作者:太空狗 更新时间:2023-10-29 14:46:58 25 4
gpt4 key购买 nike

我在线性布局中放置了两个 android.support.v7.widget.AppCompatButton。它们在 Android 版本 4.x 和 5.x 中显示并运行良好,但在版本 6 中不显示(手机为 S7 Edge)。

    <android.support.v7.widget.AppCompatButton
android:id="@+id/btnAsk"
android:textSize="16sp"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/btn_ask"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="5dp"
android:textStyle="bold"
android:background="@drawable/round_shape_btn"
android:textColor="@color/white"/>

<android.support.v7.widget.AppCompatButton
android:id="@+id/btnBuy"
android:layout_width="0dip"
android:layout_weight="1"
android:textSize="16sp"
android:layout_height="wrap_content"
android:text="@string/btn_buy"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="5dp"
android:textStyle="bold"
android:background="@drawable/round_shape_btn"
android:textColor="@color/white" />
</LinearLayout>

我用谷歌搜索并检查了 SOF 以寻找可能的解决方案,但找不到任何有效的方法。感谢您的帮助!

最佳答案

您可以在布局中简单地使用 Button,而不是根据 docs 指定 AppCompatButton对于 AppCompatButton:

[AppCompatButton] will automatically be used when you use Button in your layouts. You should only need to manually use this class when writing custom views.

关于android - AppCompatButton 在 Android Marshmallow 上不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39004784/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com