Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android xml形状声明中的滑稽错误_Android_Xml_User Interface - Fatal编程技术网

Android xml形状声明中的滑稽错误

Android xml形状声明中的滑稽错误,android,xml,user-interface,Android,Xml,User Interface,我正在创建一个用作按钮背景的形状。我正在做一个按钮条,左边的按钮在左边有圆角,右边的最后一个按钮在右边有圆角。这非常简单,api文档向您展示了如何做到这一点。但是,当我使用android:topLeftRadius和android:bottomLeftRadius时,UI中的结果就像我放置了bottomRightRadius一样。另一方也是如此。看来,无论是谁实现了这一点,他都会交换bottomRight和bottomLeft。我将在下面发布一段代码 是否有一些逻辑上的原因,我可能会错过?或者,

我正在创建一个用作按钮背景的形状。我正在做一个按钮条,左边的按钮在左边有圆角,右边的最后一个按钮在右边有圆角。这非常简单,api文档向您展示了如何做到这一点。但是,当我使用
android:topLeftRadius
android:bottomLeftRadius
时,UI中的结果就像我放置了bottomRightRadius一样。另一方也是如此。看来,无论是谁实现了这一点,他都会交换bottomRight和bottomLeft。我将在下面发布一段代码

是否有一些逻辑上的原因,我可能会错过?或者,如果这是Android工程师的一个错误,那么一旦他们修复了它,它会保持向后兼容吗?我想他们必须创建所有新属性以保持旧属性的有效性(可能是leftTop而不是topLeft?)


看起来像一个bug,请参见和。

我似乎找不到它,但我记得在某个地方读到过一个bug,它要求您首先覆盖整个半径,然后将您不想要的半径设置回原位;例如:

<corners
    android:radius="8dp"
    android:topRightRadius="0dp"
    android:bottomLeftRadius="0dp"
    />

我不能保证成功,但你可以试一试

编辑:啊,甜甜圈似乎有正确的答案。


<corners android:topLeftRadius="0.1dp" 
android:topRightRadius="6dp" 
android:bottomRightRadius="0.1dp" 
android:bottomLeftRadius="6px" />
这将适用于左上角和右上角。根据您的要求对其进行调整

可能重复的
<corners android:topLeftRadius="0.1dp" 
android:topRightRadius="6dp" 
android:bottomRightRadius="0.1dp" 
android:bottomLeftRadius="6px" />