MainActivity
- package com.zhy.zhy_fragments; import android.app.Activity;
- import android.os.Bundle; import android.view.Window;
- public class MainActivity extends Activity {
- @Override protected void onCreate(Bundle savedInstanceState)
- { super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main);
- } }
Activity的布局文件:
- <RelativeLayout xmlns:android="http://www.easck.com/apk/res/android" xmlns:tools="http://www.easck.com/tools"
- android:layout_width="match_parent" android:layout_height="match_parent" >
- <fragment android:id="@+id/id_fragment_title"
- android:name="com.zhy.zhy_fragments.TitleFragment" android:layout_width="fill_parent"
- android:layout_height="45dp" /> <fragment
- android:layout_below="@id/id_fragment_title" android:id="@+id/id_fragment_content"
- android:name="com.zhy.zhy_fragments.ContentFragment" android:layout_width="fill_parent"
- android:layout_height="fill_parent" /> </RelativeLayout>










