mercredi 13 mai 2015

Android Tabcontent overlap with tab

Hi I need some help with Tab. Got some layout advice need to consult. My current tabcontent seems to overlap with my tab. Anyway to go about preventing that?

Problem with layout![enter image description here]

Tab1

 public class Tab1Activity  extends Activity{
        @Override
        public void onCreate(Bundle savedInstanceState)
        {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.tab1);
        }}

Tab1 xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Welcome" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10" >

        <requestFocus />
    </EditText>

    <EditText
        android:id="@+id/editText2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10" />

    <EditText
        android:id="@+id/editText3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button" />

</LinearLayout>

main.xml

<?xml version="1.0" encoding="utf-8"?>

<TabHost xmlns:android="http://ift.tt/nIICcg"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
          android:id="@android:id/tabhost">

        <LinearLayout 
                android:id="@+id/LinearLayout01"
                android:orientation="vertical" 
                android:layout_height="fill_parent"
                android:layout_width="fill_parent">



                <FrameLayout 
                    android:id="@android:id/tabcontent"
                    android:layout_height="fill_parent"
                     android:layout_width="fill_parent">

                 <TabWidget 
                    android:id="@android:id/tabs"
                    android:layout_height="wrap_content" 
                    android:layout_width="fill_parent">
                </TabWidget>

                </FrameLayout>

        </LinearLayout>

</TabHost>

Aucun commentaire:

Enregistrer un commentaire