when I learn fragment on
http://developer.android.com/reference/android/app/Fragment.html
I saw the following code in layout-land/fragment_layout.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent" android:layout_height="match_parent">
<fragment class="com.example.android.apis.app.FragmentLayout$TitlesFragment"
android:id="@+id/titles" android:layout_weight="1"
android:layout_width="0px" android:layout_height="match_parent" />
<FrameLayout android:id="@+id/details" android:layout_weight="1"
android:layout_width="0px" android:layout_height="match_parent"
android:background="?android:attr/detailsElementBackground" />
</LinearLayout>
why the layout_width's of fragment and framelayout are both set to zero ??
I tried the same xml on portrait orientation, setting android:orientation="vertical"
, and a blank screen was shown. So what's the secret in there? I mean what's the difference between vertical and horizontal? what's the special feature of that FrameLayout
?