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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:44:07+00:00 2026-05-12T18:44:07+00:00

The app I’m working on has 4 tabs, 3 of which share many features,

  • 0

The app I’m working on has 4 tabs, 3 of which share many features, including a navigation bar a the bottom with Back, Edit, and Map buttons. There is exactly the same xml in all 3 layouts, so I’m trying to DRY this out by extracting that xml into a separate component, including it, and then going from there.

Previously I had

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent">

        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                        android:id="@+id/showedit_toolbar"
                        style="@style/showItemToolbar">

            <ImageButton android:id="@+id/show_person_back_button"
                    style="@style/blackToolbarButton"
                    android:src="@drawable/left_white_arrow"
                    android:layout_alignParentLeft="true"/>

            <Button android:id="@+id/show_person_map_button"
                    style="@style/blackToolbarButton"
                    android:text="map"
                    android:layout_alignParentRight="true"/>

            <Button android:id="@+id/show_person_edit_button"
                    style="@style/blackToolbarButton"
                    android:text="edit"
                    android:layout_toLeftOf="@id/show_person_map_button"/>                          
        </RelativeLayout>

        <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_height="fill_parent" 
            android:layout_width="fill_parent"           
            android:layout_above="@id/showedit_toolbar"
            style="@style/CoinLightTheme">

// Lots more layout omitted

I extracted out the bit that’s repeated into an xml file called show_toolbar.xml, changing the names of variables to make it more generic across the 3 views

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/show_toolbar"
    style="@style/showItemToolbar">

    <ImageButton style="@style/blackToolbarButton"
        android:src="@drawable/left_white_arrow"
        android:layout_alignParentLeft="true" 
        android:id="@+id/show_back_button"/>

    <Button android:id="@+id/show_map_button"
        style="@style/blackToolbarButton"
        android:text="map"
        android:layout_alignParentRight="true"/>

    <Button android:id="@+id/show_edit_button"
        style="@style/blackToolbarButton"
        android:text="edit"
        android:layout_toLeftOf="@id/show_map_button"/>                         

</RelativeLayout>

Then from within my original layout file, I replaced that big block of code with

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent">

    <include android:id="@+id/show_toolbar" layout="@layout/show_toolbar"/>

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_height="fill_parent" 
        android:layout_width="fill_parent"
        android:layout_above="@id/showedit_toolbar"         
        style="@style/CoinLightTheme">

Now, the problem is that the view no longer shows up. I can still click the buttons and they respond (i.e. if I click in the corner where the button should be, it still works), but I cannot see the buttons or bar onto which they were drawn.

I cannot find very good documentation on how Include is supposed to work, so perhaps I am using it incorrectly. Any help would be appreciated

Before

Before http://i34.tinypic.com/2dl0hm1.png

After

After

  • 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-12T18:44:07+00:00Added an answer on May 12, 2026 at 6:44 pm

    RelativeLayout supports vertical stacking of widgets. According to your layouts, your “toolbar” will be hidden behind the ScrollView, AFAICT. If you do not want that behavior, adjust your layouts such that these do not overlap.

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

Sidebar

Related Questions

Our app has a rotating map view which aligns with the compass heading. We
App I'm working on uses ARC. I wanted it to process large files, so
The app I am working on is supporting android 2.3 upwards. As the download
App A has this BroadcastReceiver in its manifest (within <application>): And this receiver: public
An app I recently had approved for sale on the iTunes store has been
App has fragment activity with framelayout container matching parent. User interacts with fragments ui
My app has the following models: user and watch_list. User has attributes id, name
App with Facebook SDK SSO was working fine in 2.2, now upgraded Samsung Galaxy
An app I'm working on interfaces with an existing application running on a remote
'app name' specifies a minimum os of version 4.3, which is too high to

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.