Directly on the code and picture.
Situation One:
[HTML]
Copy Code code as follows:
<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Horizontal" >
<fragment
Android:id= "@+id/titles"
Android:layout_width= "0dip"
android:layout_height= "Match_parent"
android:layout_weight= "1"
class= "Com.a2bgeek.fragmentdemo.TitlesFragment"/>
<framelayout
Android:id= "@+id/details"
Android:layout_width= "0dip"
android:layout_height= "Match_parent"
android:layout_weight= "2" >
</FrameLayout>
</LinearLayout>
<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Horizontal" >
<fragment
Android:id= "@+id/titles"
Android:layout_width= "0dip"
android:layout_height= "Match_parent"
android:layout_weight= "1"
class= "Com.a2bgeek.fragmentdemo.TitlesFragment"/>
<framelayout
Android:id= "@+id/details"
Android:layout_width= "0dip"
android:layout_height= "Match_parent"
android:layout_weight= "2" >
</FrameLayout>
</LinearLayout>
<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Horizontal" >
<fragment
Android:id= "@+id/titles"
Android:layout_width= "0dip"
android:layout_height= "Match_parent"
android:layout_weight= "1"
class= "Com.a2bgeek.fragmentdemo.TitlesFragment"/>
<framelayout
Android:id= "@+id/details"
Android:layout_width= "0dip"
android:layout_height= "Match_parent"
android:layout_weight= "2" >
</FrameLayout>
</LinearLayout>
Situation 2:
[HTML]
Copy Code code as follows:
<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Horizontal" >
<fragment
Android:id= "@+id/titles"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:layout_weight= "1"
class= "Com.a2bgeek.fragmentdemo.TitlesFragment"/>
<framelayout
Android:id= "@+id/details"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:layout_weight= "2" >
</FrameLayout>
</LinearLayout>
<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:orientation= "Horizontal" >
<fragment
Android:id= "@+id/titles"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:layout_weight= "1"
class= "Com.a2bgeek.fragmentdemo.TitlesFragment"/>
<framelayout
Android:id= "@+id/details"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
android:layout_weight= "2" >
</FrameLayout>
</LinearLayout>
Situation Three:
Fragment this thing will occupy all the wrap_content, and the control is not the same.