Android学习笔记之fragment的静态加载和动态加载

分享到:

1.xml布局文件:

main.xml

 

 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 2     android:layout_width="match_parent"
 3     android:layout_height="match_parent" >
 4     
 5     <LinearLayout 
 6         android:id="@+id/linearLayout"
 7         android:layout_width="match_parent"
 8         android:layout_height="wrap_content"
 9         android:orientation="vertical"></LinearLayout>
10     
11     
12     <RadioGroup 
13         android:id="@+id/radioGroup"
14         android:layout_width="match_parent"
15         android:layout_height="wrap_content"
16         android:orientation="horizontal"
17         android:layout_alignParentBottom="true"
18   >
19         
20         <RadioButton
21             android:id="@+id/first"
22             android:layout_width="0dp"
23             android:layout_height="wrap_content"
24             android:layout_weight="1"
25             
26             android:button="@null"
27             android:drawableTop="@drawable/ic_launcher"
28             android:gravity="center_horizontal"
29             android:text="静态加载" />
30         
31         <RadioButton
32             android:id="@+id/secnod"
33             android:layout_width="0dp"
34             android:layout_height="wrap_content"
35             android:layout_weight="1"
36             
37             android:button="@null"
38             android:drawableTop="@drawable/ic_launcher"
39             android:gravity="center_horizontal"
40             android:text="动态加载" />
41         
42         <RadioButton
43             android:id="@+id/three"
44             android:layout_width="0dp"
45             android:layout_height="wrap_content"
46             android:layout_weight="1"
47            
48             android:button="@null"
49             android:drawableTop="@drawable/ic_launcher"
50             android:gravity="center_horizontal"
51             android:text="静态加载" />
52         
53         <RadioButton
54             android:id="@+id/four"
55             android:layout_width="0dp"
56             android:layout_height="wrap_content"
57             android:layout_weight="1"
58             
59             android:button="@null"
60             android:drawableTop="@drawable/ic_launcher"
61             android:gravity="center_horizontal"
62             android:text="静态加载" />
63     </RadioGroup>
64 
65 </RelativeLayout>
昵    称:
验证码:

相关文档: