Skip to content

Commit 5779446

Browse files
committed
a better sample
1 parent a2167ff commit 5779446

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
23
xmlns:tools="http://schemas.android.com/tools"
34
android:layout_width="match_parent"
@@ -7,24 +8,25 @@
78
android:paddingTop="@dimen/activity_vertical_margin"
89
android:paddingBottom="@dimen/activity_vertical_margin"
910
tools:context=".MyActivity">
11+
1012
<LinearLayout
11-
android:id="@+id/hello_world_wrapper"
12-
android:layout_width="wrap_content"
13-
android:gravity="center"
13+
android:id="@+id/wrapper"
14+
android:layout_width="match_parent"
1415
android:layout_height="wrap_content">
15-
<TextView
16-
android:padding="30dp"
17-
android:textSize="40sp"
18-
android:id="@+id/hello_world"
19-
android:text="@string/hello_world"
20-
21-
android:layout_width="wrap_content"
22-
android:layout_height="wrap_content" />
16+
<TextView
17+
android:gravity="center"
18+
android:layout_weight="1"
19+
android:padding="30dp"
20+
android:textSize="40sp"
21+
android:id="@+id/hello_world"
22+
android:text="@string/hello_world"
23+
android:layout_centerHorizontal="true"
24+
android:layout_width="wrap_content"
25+
android:layout_height="wrap_content" />
2326
</LinearLayout>
24-
2527
<ListView
2628
android:id="@+id/list_items"
27-
android:layout_below="@+id/hello_world_wrapper"
29+
android:layout_below="@+id/wrapper"
2830
android:layout_width="wrap_content"
2931
android:layout_height="wrap_content"/>
30-
</RelativeLayout>
32+
</RelativeLayout>

0 commit comments

Comments
 (0)