微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Android:圆角在不同的Android版本中有所不同

我对角标签有问题.

这是我的形状文件.

<stroke
    android:width="1dp"
    android:color="#ff999999" />

<size android:height="40dp" />

<gradient
    android:angle="90"
    android:centerColor="#f5f5f5"
    android:endColor="#fcfcfc"
    android:startColor="#efefef"
    android:type="linear" />

<corners
    android:bottomLefTradius="0dip"
    android:bottomrighTradius="8dip"
    android:topLefTradius="8dip"
    android:topRighTradius="0dip" />

但是当我为视图的背景设置它时.它在Android 2.2和Android 4.0.3中显示不同的形状.
当它在Android 4.0.3:running on Android 4.0.3上运行时
在Android 2.2:Running on Android 2.2

请参阅“ANNOUNCE”按钮.
你知道为什么吗 ?我该如何解决
请帮我 !
对不起,因为我的英语不是很好.

解决方法

这是SDK的pre-API 12版本中的一个错误,其中左下角和右下角的半径相反.您可以做什么(并且在 this link处有更多信息)是创建res / drawable-v12文件夹,并将这些drawables复制到其中,半径反转(即左下半径变为右下半径,反之亦然),并且将为API 12以上的设备自动选择这些drawable.

原文地址:https://www.jb51.cc/android/313013.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐