来自:http://www.dabu.info/android-shape-drawable-create-jian-liang-side-semicircle-backgound-button.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<
?xml
version=
"1.0"
encoding=
"utf-8"
?
>
<shape
xmlns
:android="http
://schemas.android.com/apk/res/android"
android
:shape="rectangle"
android
:color="@color/colorAccent"
>
<corners
android
:radius="60dip"
/
>
<stroke
android
:width="0dp"
android
:color="@color/colorAccent" /
>
<solid
android
:color="@color/colorAccent" /
>
</shape
>
|
1
2
3
4
5
6
7
8
9
10
11
12
|
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
android
:
shape
=
"rectangle"
>
android
:
bottomRightRadius
=
"30dp"
android
:
bottomLeftRadius
=
"30dp"
android
:
topRightRadius
=
"30dp"
android
:
topLeftRadius
=
"30dp"
/>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
xmlns
:
android
=
"http://schemas.android.com/apk/res/android"
xmlns
:
tools
=
"http://schemas.android.com/tools"
android
:
layout_width
=
"match_parent"
android
:
layout_height
=
"match_parent"
tools
:
context
=
".MainActivity"
>
android
:
text
=
"Hello World!"
android
:
id
=
"@+id/tv1"
android
:
background
=
"@drawable/semi_round_backgroud"
android
:
layout_width
=
"wrap_content"
android
:
layout_height
=
"wrap_content"
android
:
layout_centerInParent
=
"true"
android
:
textSize
=
"25dp"
android
:
paddingTop
=
"8dp"
android
:
paddingBottom
=
"8dp"
android
:
paddingRight
=
"15dp"
android
:
paddingLeft
=
"15dp"
/>
android
:
text
=
"Hello World!"
android
:
id
=
"@+id/tv2"
android
:
background
=
"@drawable/semi2"
android
:
layout_width
=
"wrap_content"
android
:
layout_height
=
"wrap_content"
android
:
layout_centerInParent
=
"true"
android
:
textSize
=
"25dp"
android
:
paddingTop
=
"8dp"
android
:
paddingBottom
=
"8dp"
android
:
paddingRight
=
"15dp"
android
:
paddingLeft
=
"15dp"
android
:
layout_below
=
"@+id/tv1"
android
:
layout_marginTop
=
"15dp"
/>
|