Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7128647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:09:37+00:00 2026-05-28T11:09:37+00:00

I have created a custom tab layout which look like this,I want to make

  • 0

I have created a custom tab layout which look like this,I want to make the background of top bar same as bottom bar that mean shaded in two part how could i do this,please suggest:

this is my main.xml

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


  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@drawable/bac_tab"
android:id="@+id/mymain_layout" android:weightSum="1">

<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="@drawable/bac_tab">
    <LinearLayout android:orientation="vertical"
        android:layout_width="fill_parent" android:layout_height="fill_parent">
        <View android:layout_width="fill_parent" android:layout_height="0.5dip"
            android:background="#000" />
        <TabWidget android:id="@android:id/tabs" android:layout_marginTop="5dip" android:layout_marginBottom ="5dip"
             android:layout_width="fill_parent"
            android:layout_marginLeft="30dip" android:layout_marginRight="30dip" android:background="@null"
            android:layout_height="40dp" />

        <FrameLayout android:id="@android:id/tabcontent"
            android:layout_width="fill_parent" android:layout_height="fill_parent">
            <LinearLayout android:background="#ffffff"
                android:orientation="vertical" android:layout_width="fill_parent"
                android:layout_height="fill_parent" android:id="@+id/main">
                <ListView android:id="@+id/list" android:layout_width="fill_parent"
                    android:background="#ffffff" android:layout_height="fill_parent"
                    android:layout_weight="1" />
                <TextView android:id="@+id/empty" android:layout_width="wrap_content"
                    android:layout_height="wrap_content" android:gravity="center"
                    android:text="" android:textColor="#000000" />
            </LinearLayout>
            <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/mainlayout" android:orientation="vertical"
                android:layout_width="fill_parent" android:layout_height="fill_parent">
                <TextView android:id="@+id/empty" android:layout_width="wrap_content"
                    android:layout_height="wrap_content" android:gravity="center"
                    android:text="" android:textColor="#000000" />

            </RelativeLayout>
        </FrameLayout>
    </LinearLayout>
</TabHost>
<RelativeLayout android:gravity="bottom"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true" android:background="@drawable/bac_tab">

</RelativeLayout>

and bac_tab.xml

<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">


<item>        
    <shape>
        <gradient
             android:endColor="#000000"
             android:startColor="#696969"
             android:centerColor="#696969"
            android:angle="270" />
        <stroke

            android:color="#696969" />
       <padding
            android:left="2dp"
            android:top="3dp"
            android:right="2dp"
            android:bottom="3dp" />
    </shape>
</item>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:09:37+00:00Added an answer on May 28, 2026 at 11:09 am

    I got the desirable result by using the transparent background for TabHost and use the shaded background as first layer:

      <?xml version="1.0" encoding="utf-8"?>
    
      <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background="@drawable/bac_tab"
    android:id="@+id/mymain_layout" android:weightSum="1">
    
    *<!---by adding this in the background----->
    
        <RelativeLayout android:gravity="bottom"
                android:layout_width="fill_parent" android:layout_height="51dp"
                android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
                android:background="@drawable/newbac"></RelativeLayout>
    
        <!---------------------------------------------------------->*
    
        <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="@drawable/@android:color/transparent">***
            <LinearLayout android:orientation="vertical"
                android:layout_width="fill_parent" android:layout_height="fill_parent">
                <View android:layout_width="fill_parent" android:layout_height="0.5dip"
                    android:background="#000" />
                <TabWidget android:id="@android:id/tabs" android:layout_marginTop="5dip" android:layout_marginBottom ="5dip"
                     android:layout_width="fill_parent"
                    android:layout_marginLeft="30dip" android:layout_marginRight="30dip" android:background="@null"
                    android:layout_height="40dp" />
    
                <FrameLayout android:id="@android:id/tabcontent"
                    android:layout_width="fill_parent" android:layout_height="fill_parent">
                    <LinearLayout android:background="#ffffff"
                        android:orientation="vertical" android:layout_width="fill_parent"
                        android:layout_height="fill_parent" android:id="@+id/main">
                        <ListView android:id="@+id/list" android:layout_width="fill_parent"
                            android:background="#ffffff" android:layout_height="fill_parent"
                            android:layout_weight="1" />
                        <TextView android:id="@+id/empty" android:layout_width="wrap_content"
                            android:layout_height="wrap_content" android:gravity="center"
                            android:text="" android:textColor="#000000" />
                    </LinearLayout>
                    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                        android:id="@+id/mainlayout" android:orientation="vertical"
                        android:layout_width="fill_parent" android:layout_height="fill_parent">
                        <TextView android:id="@+id/empty" android:layout_width="wrap_content"
                            android:layout_height="wrap_content" android:gravity="center"
                            android:text="" android:textColor="#000000" />
    
                    </RelativeLayout>
                </FrameLayout>
            </LinearLayout>
        </TabHost>
        <RelativeLayout android:gravity="bottom"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true" android:background="@drawable/bac_tab">
    
        </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom tag that looks like this: def textField = {
I'm trying to create a custom tab navigator that has to look like this
I have created a custom tab in admin which I need to manage customer
I have created a custom module which displays a tab and a section in
I am implementing a tab;e in which i have created a custom cell for
friends, i have created custom title bar using following titlebar.xml file with code <?xml
If have created a custom role within SqlServer which I added to the db__denydatareader
I have created a custom ExpandableListAdapter and everything works properly. What I'd like to
I created a tab bar application, and I make the first tab a table.
I have created a button widget with custom images by referring this article. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.