Android&各种布局

FrameLayout
activity_main.xml
 1 <FrameLayout android:id="@+id/myFrameLayout"
 2         android:layout_width="match_parent" android:layout_height="match_parent">
 3         <TextView    android:id="@+id/smallTextView"  android:text="@string/small"
 4             android:layout_width="wrap_content"  android:layout_height="wrap_content"
 5             android:textColor="@color/red"  android:textSize="24dip"
 6             android:textStyle="bold"
 7             />
 8         <TextView    android:id="@+id/middleTextView"    android:text="@string/middle"
 9             android:layout_width="wrap_content"        android:layout_height="wrap_content"
10             android:textColor="@color/blue"    android:textSize="40dip"
11             android:textStyle="bold"
12             />            
13        <TextView    android:id="@+id/bigTextView"    android:text="@string/big"
14            android:layout_width="wrap_content"        android:layout_height="wrap_content"
15            android:textColor="@color/green"    android:textSize="60dip"
16            android:textStyle="italic"
17            />
18         
19     </FrameLayout>

TableLayout

activity_main.xml
 1 <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
 2     xmlns:tools="http://schemas.android.com/tools"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:paddingBottom="@dimen/activity_vertical_margin"
 6     android:paddingLeft="@dimen/activity_horizontal_margin"
 7     android:paddingRight="@dimen/activity_horizontal_margin"
 8     android:paddingTop="@dimen/activity_vertical_margin"
 9     tools:context=".MainActivity"
10     android:shrinkColumns="2"    
11     android:stretchColumns="0, 1"    
12       android:background="@drawable/background"
13     >
14     <TableRow>
15         <TextView    android:text="University"
16             android:padding="3dip"
17             android:gravity="center"
18             android:textColor="@color/green"
19             />
20         <TextView    android:text="City"
21             android:padding="3dip"
22             android:gravity="center"
23             android:textColor="@color/green"
24             />
25            <TextView    android:text="About"
26                android:padding="3dip"
27                android:gravity="center"
28                android:textColor="@color/green"
29                /> 
30     </TableRow>
31     <TableRow>
32         <TextView    android:text="华东师范大学"
33             android:padding="3dip"
34             android:gravity="center"
35             android:textColor="@color/green"
36             />
37         <TextView    android:text="上海"
38             android:padding="3dip"
39             android:gravity="center"
40             android:textColor="@color/green"
41             />
42         <TextView    android:text="@string/ECNU"
43             android:padding="3dip"
44             android:gravity="center" 
45             android:textColor="@color/green"
46             />
47     </TableRow>
48     <TableRow>
49         <TextView    android:text="中山大学"
50             android:padding="3dip"
51             android:gravity="center"
52             android:textColor="@color/blue"
53             />
54         <TextView    android:text="广东"
55             android:padding="3dip"
56             android:gravity="center"
57             android:textColor="@color/blue"
58             />
59         <TextView    android:text="@string/SYSU"
60                android:padding="3dip"
61             android:gravity="center"
62             android:textColor="@color/blue"
63             />
64         </TableRow>
65         <TableRow>
66             <TextView    android:text="同济大学"
67             android:padding="3dip"
68             android:gravity="center"
69             android:textColor="@color/yellow"
70             />
71         <TextView    android:text="上海"
72             android:padding="3dip"
73             android:gravity="center"
74             android:textColor="@color/yellow"
75             />
76         <TextView    android:text="@string/Tongji"
77                android:padding="3dip"
78             android:gravity="center"
79             android:textColor="@color/yellow"
80             />
81         </TableRow>
82  
83 </TableLayout>

 

posted on 2013-03-13 21:21  Zachary_wiz  阅读(151)  评论(0编辑  收藏  举报

导航