Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
选项卡内容未在FragmentTabHost Android上显示_Android_Android Layout_Android Fragments_Android Tabhost - Fatal编程技术网

选项卡内容未在FragmentTabHost Android上显示

选项卡内容未在FragmentTabHost Android上显示,android,android-layout,android-fragments,android-tabhost,Android,Android Layout,Android Fragments,Android Tabhost,我尝试过使用FragmentTabHost。一切都进行得很顺利,并且成功地显示了选项卡。但我的片段没有显示那个类的布局。我尝试过使用TextView,但仍然没有出现。 请帮帮我 我的零碎活动 public class ViewDetailAnak extends FragmentActivity{ private static String idanak; private FragmentTabHost tabHost; private static final String TRANS_S

我尝试过使用FragmentTabHost。一切都进行得很顺利,并且成功地显示了选项卡。但我的片段没有显示那个类的布局。我尝试过使用TextView,但仍然没有出现。 请帮帮我

我的零碎活动

public class ViewDetailAnak extends FragmentActivity{

private static String idanak;

private FragmentTabHost tabHost;
private static final String TRANS_SPEC = "";
private static final String US_SPEC = "";
private static final String TABU_SPEC =  "";

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fro_single_item_anak);


      tabHost = (FragmentTabHost)findViewById(android.R.id.tabhost);
      tabHost.setup(this, getSupportFragmentManager(),android.R.id.tabcontent);

        tabHost.addTab(
                tabHost.newTabSpec(TRANS_SPEC)
                .setIndicator(TRANS_SPEC, getResources().getDrawable(R.drawable.icon_trans)),
                FROVDATransaksi.class, null);
        tabHost.addTab(
                tabHost.newTabSpec(US_SPEC)
                .setIndicator(US_SPEC, getResources().getDrawable(R.drawable.icon_us)),
                FROVDAUangsaku.class, null);
        tabHost.addTab(
                tabHost.newTabSpec(TABU_SPEC)
                .setIndicator(TABU_SPEC, getResources().getDrawable(R.drawable.icon_tab)),
                FROVDATabungan.class, null);
}
三块碎片中的一块

 public static class FROVDAUangsaku extends Fragment {
 @Override
 public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
 }

 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
                           Bundle savedInstanceState) {
     View v = inflater.inflate(R.layout.fro_vda_uangsaku, container, false);
     return v;


}
   }
这是XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical" >

<TableLayout
    android:id="@+id/tableLayout1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true" >

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginLeft="14dp"
        android:clipToPadding="true"
        android:paddingTop="15dp" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <ImageView
                android:id="@+id/imageView1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/user1" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:paddingLeft="10dp" >

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_weight="15.86"
                    android:orientation="vertical"
                    android:paddingLeft="10dp" >

                    <TextView
                        android:id="@+id/txtNama_FRO_Profil"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceLarge"
                        android:textColor="@color/nama" />

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:orientation="horizontal" >

                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:orientation="vertical"
                            android:paddingRight="10dp" >

                            <TextView
                                android:id="@+id/txNama_fra_profil"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_vertical|center_horizontal"
                                android:text="Uang Saku"
                                android:textColor="#666666"
                                android:textSize="9dp" />

                            <TextView
                                android:id="@+id/txtJumlahAnak_FRO_Profil"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_vertical|center_horizontal"
                                android:textColor="#000000"
                                android:textSize="12dp" />
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="vertical" >

                            <TextView
                                android:id="@+id/txtnomuangsaku"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_vertical|center_horizontal"
                                android:text="Tabungan"
                                android:textColor="#666666"
                                android:textSize="9sp" />

                            <TextView
                                android:id="@+id/saldotabungan"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center_vertical|center_horizontal"
                                android:textColor="#000000"
                                android:textSize="12dp" />
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="match_parent"
                            android:orientation="vertical" >

                            <Button
                                android:id="@+id/btnLogoutFRO_profilo"
                                android:layout_width="wrap_content"
                                android:layout_height="30dp"
                                android:layout_marginLeft="10dp"
                                android:gravity="center"
                                android:text="Edit Profile"
                                android:textColor="#000000"
                                android:textSize="12sp" />

                        </LinearLayout>

                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </TableRow>

      <View
          android:layout_height="2dip"
          android:layout_marginTop="5dp"
          android:background="#666666" />

</TableLayout>
<android.support.v4.app.FragmentTabHost
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/tableLayout1">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="match_parent"
            android:layout_height="38dp" />
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="1"/>


    </LinearLayout>
</android.support.v4.app.FragmentTabHost>
忽略内部表格布局。唯一的设计。我在TableLayout下创建fragmenttab