形状矩形角(android)
对不起我的英语。我只想创建左上角半径的线条布局。例如: 这是我的xml:形状矩形角(android),android,xml,Android,Xml,对不起我的英语。我只想创建左上角半径的线条布局。例如: 这是我的xml: <LinearLayout android:id="@+id/getbonusClick" android:layout_width="wrap_content" android:layout_height="wrap_content" android:b
<LinearLayout
android:id="@+id/getbonusClick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_corner_left_top"
android:orientation="vertical" />
它是我的形状,在角落里,在左边,在上面
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<item>
<shape>
<solid android:color="#EC6118"/>
<corners android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dip"
android:topLeftRadius="10dip"
android:topRightRadius="0.1dp"/>
</shape>
</item>
</selector>
其结果是:
我只需要左上角的半径。我是怎么做的 我刚检查过,使用此代码,您的问题就会解决
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="10dp"
android:bottomRightRadius="0dp" android:bottomLeftRadius="0dp"
android:topLeftRadius="10dp" android:topRightRadius="0dp"/>
<solid android:color="@android:color/black"/>
<stroke android:width="1dp"
android:color="@android:color/holo_blue_dark"/>
</shape>
eclipse上的预览不正确,请在设备上运行它。你会找到解决办法的
谢谢为什么topRightRadius=“0.1dp”?@Blackbelt如果我设置了
topRightRadius=“0dp”
没有任何更改,您确定要修改正确的文件吗?同一文件是否有多个版本?您在哪里测试它?android:background=“@drawable/asdasdswqweqwdasdasdad.xml”
不是有效的资源id。请删除.xml
。但是,使用这样的名称很容易出错。