<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:context=".ActionTab_Activity" >
<!-- 一定要tool:comtext -->
<!--如果是fragment,一定要设置某fragment名字
如 android:name="com.cohere.fc.FragmentProcess"
表示启动时先加载某fragment
-->
<Fragment
android:id="@+id/main_titles"
android:name="com.cohere.fc.FragmentProcess"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1" />
<pre name="code" class="html"> <!-- FrameLayout是一个放置Fragment的容器 ,
不需要指定某个Fragment的名字,
可以通过FragmentManager动态添加删除想放入其中的Fragment-->
<FrameLayout android:id="@+id/main_details" android:layout_width="0px" android:layout_height="match_parent" android:layout_weight="4" /></LinearLayout>
FrameLayout与Fragment标签都是用来放Fragment的,区别是,Fragment标签只能设置固定的Fragment,而FrameLayout中可以通过FragmentManager更换Fragment