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 7669729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:39:41+00:00 2026-05-31T15:39:41+00:00

I’m developing an Android app implementing the a tabhost, viewpager, and a top-side sliding

  • 0

I’m developing an Android app implementing the a tabhost, viewpager, and a top-side sliding drawer and tabs at the bottom. The application uses the android-support-v4 FragmentPagerAdapter, which can be found in the samples of the v4-support-package. A reference can be found here:
http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html

I can’t seem to get both the Sliding Drawer and the TabHost to appear on the screen at the same time.

Here is my layout. The com.mobicartel… block is a custom sliding drawer. ——————————————————————————————-

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:my="http://schemas.android.com/apk/res/com.mobicartel.tabsandpager"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <com.mobicartel.tabsandpager.slidingdrawer.MultiDirectionSlidingDrawer
        xmlns:my="http://schemas.android.com/apk/res/com.mobicartel.tabsandpager"
        android:id="@+id/drawer"
        my:direction="topToBottom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        my:handle="@+id/handle"
        my:content="@+id/content">
        <include
            android:id="@id/content"
            layout="@layout/pen_content" />
        <ImageButton
            android:id="@id/handle"
            android:layout_width="wrap_content"
            android:layout_height="40px"
            android:src="@drawable/sliding_drawer_handle_bottom" />
    </com.mobicartel.tabsandpager.slidingdrawer.MultiDirectionSlidingDrawer>    

<FrameLayout
    android:id="@+id/tab_host_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    android:layout_below="@+id/drawer">

    <TabHost    
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

      <android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"/>

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_weight="0"/>

          <TabWidget
            android:id="@android:id/tabs"
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"
            android:layout_marginBottom="-4dip"/>

    </LinearLayout>

</TabHost>
</FrameLayout>    

The content of TabHost actually isn’t being displayed. Instead, the tab listener & viewpager listener control each other so they are in sync. The ViewPager is populated with fragments by a special adapter.

Any ideas?

Does anybody

  • 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-31T15:39:43+00:00Added an answer on May 31, 2026 at 3:39 pm

    I’ve never used TabHost with tabs at the bottom, because it is advised against (in the official Design Guidelines), however, it appears that you are using the hack found here: https://stackoverflow.com/a/2710404/377260.

    I notice that your FrameLayout weight is 0, along with the height and width. Try setting them to:

    <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="5dp"
            android:layout_weight="1"/>
    

    as found in the answer linked to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.