我正在创建一个形状用作按钮背景。我正在制作一条按钮,左边的按钮在左边有圆角,右边的最后一个在右边有圆角。这非常简单,API 文档向您展示了如何做到这一点。然而,当我使用android:topLeftRadius
and android:bottomLeftRadius
,UI 中的结果就好像我放置了 BottomRightRadius。另一边也有同样的行为。看来无论是谁实现了这个,都交换了右下角和左下角。我将发布下面的代码片段。
我可能会遗漏一些逻辑原因吗?或者,如果这是 Android 工程师的错误,一旦他们修复它,它会保持向后兼容吗?我想他们必须使所有新属性保持旧属性有效(也许是 leftTop 而不是 topLeft?)。
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<solid android:color="#99000000" />
<padding
android:top="8dp"
android:left="8dp"
android:right="8dp"
android:bottom="8dp" />
<corners
android:topLeftRadius="8dp"
android:bottomRightRadius="8dp" />
</shape>
</item>
看起来像一个错误,看看这个问题 http://code.google.com/p/android/issues/detail?id=9161 and 这个问题 https://stackoverflow.com/questions/3056232/how-to-make-a-shape-with-left-top-round-rounded-corner-and-left-bottom-rounded-co/3056377#3056377.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)