我想制作一个带有左上角圆角和左下角圆角的形状:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#555555"/>
<stroke android:width="3dp"
android:color="#555555"
/>
<padding android:left="1dp"
android:top="1dp"
android:right="1dp"
android:bottom="1dp"
/>
<corners android:bottomRightRadius="0dp" android:bottomLeftRadius="2dp"
android:topLeftRadius="2dp" android:topRightRadius="0dp"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
但上面的形状没有给我我想要的东西.它给了我一个没有任何圆角的矩形.
有人可以帮忙吗?
谢谢.
我正在玩角落,我对这种行为很感兴趣.XML布局:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/list_header_title"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:padding="10dip"
android:gravity="center_vertical"
android:background="@layout/my_outline"
android:text="Example"
android:textSize="14sp"
android:textStyle="bold"
/>
Run Code Online (Sandbox Code Playgroud)
这是my_outline.xml :( 注意角标记)
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:topLeftRadius="10dip"
android:bottomRightRadius="10dip"/>
<padding
android:left="50dip"
android:top="5dip"
android:bottom="5dip" />
<solid
android:color="#0fff" />
<stroke
android:width="1dip"
android:color="#f0f0f0" />
</shape>
Run Code Online (Sandbox Code Playgroud)
图片:

将形状更改为:
<corners
android:topLeftRadius="10dip"
android:bottomLeftRadius="10dip"/>
Run Code Online (Sandbox Code Playgroud)
而且你可以清楚地看到底角是倒置的(发生在所有人身上,我只是为了说明"周三").这是我的手机图片(Nexus S 2.3.2,但也发生在模拟器上):

你知道吗?我看着谷歌("android形状倒角"),什么也没得到.在这里,SO也没有"相关问题".