只能在onCreate中設置一個layout
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.[.xml名字]);
}
但若我們需要用到TabHost、Fragment或其它要用同一個容器切換不同內容時,可以用這個方法在.xml中再包進其它的layout
<absolutelayout
android:layout_height="fill_parent"
android:layout_width="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<linearlayout
android:id="@+id/layout_gift"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">
<include layout="@layout/tab_gift"></include>
</linearlayout>
</absolutelayout>
沒有留言:
張貼留言