记录自己开发中遇到的常见问题

在用圆角drawable给button设置背景时,有时会出现很明显的阴影,大多数时候并不明显,但在个别情况下(还没有弄清触发原因)阴影会非常大,必须要去掉
在对应button 的xml中加入一句代码即可
style="?android:attr/borderlessButtonStyle"
例如
<Button
android:id="@+id/bt"
android:layout_marginHorizontal="15dp"
android:layout_marginVertical="10dp"
android:paddingVertical="10dp"
android:text="确定"
android:textSize="16sp"
style="?android:attr/borderlessButtonStyle"
android:textColor="@color/white"
android:background="@drawable/bg_btn_my_car_save_blue_circle"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
这篇博客记录了在Android开发中遇到的问题,当使用圆角drawable为Button设置背景时,如何解决出现过大阴影的现象。只需在Button的XML布局中添加特定代码,即可消除不希望出现的阴影。
833

被折叠的 条评论
为什么被折叠?



