7 个解决方案
#1
你把图片分成几部分来画,上面画圆角,下面画直角,例如你圆角矩形把上面画一半,后半接直角矩形
#2

#3
不是背景处理,是直接把需要显示的图片处理成上圆角下直角的图片显示
#4
截获咯,图形构成按我上面说的,首先获取图片的大小,再考虑怎么去截对应的图形
#5
你可以用一个布局吧两边的放在那,然后上面加个ImageView放在中间
#6
写一个XML 内容是<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#ffffff" />
<stroke
android:width="0.01px"
android:color="#303030" />
<corners
android:topLeftRadius="12px"
android:topRightRadius="12px" 12代表弧度
android:bottomRightRadius="0px"
android:bottomLeftRadius="0px"
/>
</shape>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#ffffff" />
<stroke
android:width="0.01px"
android:color="#303030" />
<corners
android:topLeftRadius="12px"
android:topRightRadius="12px" 12代表弧度
android:bottomRightRadius="0px"
android:bottomLeftRadius="0px"
/>
</shape>
#7
6L正解,写个shape的XML,然后background引用就可以了!
#1
你把图片分成几部分来画,上面画圆角,下面画直角,例如你圆角矩形把上面画一半,后半接直角矩形
#2

#3
不是背景处理,是直接把需要显示的图片处理成上圆角下直角的图片显示
#4
截获咯,图形构成按我上面说的,首先获取图片的大小,再考虑怎么去截对应的图形
#5
你可以用一个布局吧两边的放在那,然后上面加个ImageView放在中间
#6
写一个XML 内容是<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#ffffff" />
<stroke
android:width="0.01px"
android:color="#303030" />
<corners
android:topLeftRadius="12px"
android:topRightRadius="12px" 12代表弧度
android:bottomRightRadius="0px"
android:bottomLeftRadius="0px"
/>
</shape>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#ffffff" />
<stroke
android:width="0.01px"
android:color="#303030" />
<corners
android:topLeftRadius="12px"
android:topRightRadius="12px" 12代表弧度
android:bottomRightRadius="0px"
android:bottomLeftRadius="0px"
/>
</shape>
#7
6L正解,写个shape的XML,然后background引用就可以了!