views:

37

answers:

1

Hi All,

I have a simple question... How can I make a simple white background under my tab style.. This is my source main source code.xml

I was thinking to make a new LinearLayout with an android:background="#ffffff"

Can anyone help thinking.. i'm an beginning android programmer ..

Thanks a lot!!

Here is my source code:

<?xml version="1.0" encoding="utf-8"?>
<!-- Tabinterface -->
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" /> 
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
             />
    </LinearLayout>
</TabHost>
<!-- Tabinterface -->
A: 

First, I'm new on Android as well, so my solution maybe it's not "the correct one", but at least it works.

I've put a background color into the TabHost, but if you don't specify a background color into the FrameLayout you'll see the background color on the whole view.

So my solution and apparently works is as follows:

<?xml version="1.0" encoding="utf-8"?>
<!-- Tabinterface -->
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
 android:id="@android:id/tabhost"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:background="#ffffff" #here
 >
 <LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" /> 
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#000000" #here
         />
  </LinearLayout>
</TabHost>
<!-- Tabinterface -->
brent
Thanks this is good enough!
anddevelop