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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:19:30+00:00 2026-05-23T16:19:30+00:00

I have the following layout (it is complex but I have to put it

  • 0

I have the following layout (it is complex but I have to put it all) ; I have 3 LinearLayouts, horizontal with a tiled png as background : 2 must be placed in the top of the screen and the last in the bottom of the screen. Between I have to put a widget gallery.

I want the 3 LinearLayouts to take the height of the png used for their backgrounds (it is ok for the 2 first but not for the last which is resized) and the gallery take the remaining size of the screen.

I cannot understand why that third LinearLayout is resized.

Thanks a lot in advance for your help. I put 2 pictures after the code to understand the situation.

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

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

<!-- THE FOLLOWING LAYOUT SHALL TAKE THE HEIGHT OF THE IMAGE USED FOR BACKGROUND
 => IT IS OK -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:orientation="horizontal"
        android:background="@drawable/bg_title" 
        android:gravity="center_horizontal">

        <TextView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/title"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/home_title"
            android:textColor="@color/white"
            android:gravity="center"
            android:textSize="20sp"/>
</LinearLayout>

<!-- THE FOLLOWING LAYOUT SHALL TAKE THE HEIGHT OF THE IMAGE USED FOR BACKGROUND
=> IT IS OK -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:orientation="horizontal"
    android:background="@drawable/bg_channel_title">
    <FrameLayout 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:id="@+id/channels_frameLayout">

        <HorizontalScrollView 
            android:id="@+id/channel_scrollView" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">

            <LinearLayout 
                android:id="@+id/channel_layout" 
                android:layout_width="match_parent" 
                android:layout_height="match_parent" 
                android:orientation="horizontal">

            </LinearLayout>
        </HorizontalScrollView>

    </FrameLayout>
</LinearLayout>

<!-- THE FOLLOWING LAYOUT SHALL TAKE THE REMAINING HEIGHT OF THE SCREEN -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:orientation="vertical"
    android:id="@+id/description_frameLayout">
    <Gallery xmlns:android="http://schemas.android.com/apk/res/android" 
        android:id="@+id/gallery"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center" 
    />
</LinearLayout>

<!-- THE FOLLOWING LAYOUT SHALL BE PLACED ON THE BOTTOM OF THE SCREEN 
AND TAKE THE HEIGHT OF THE IMAGE USED FOR BACKGROUND
=> IT IS NOK, THE LAYOUT IS RESIZED IN HEIGHT -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
    android:orientation="horizontal"
    android:background="@drawable/bg_description"
    android:id="@+id/description_layout"
    android:gravity="bottom">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content" 
        android:orientation="vertical"
        android:gravity="left"
        android:id="@+id/texts">

        <TextView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/orange"/>

        <TextView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/content"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/white"/>

    </LinearLayout>

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:orientation="vertical"
        android:gravity="right"
        android:id="@+id/btns">

        <ImageButton
            android:id="@+id/info" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@null"
            android:src="@drawable/btn_info" />

        <ImageButton
            android:id="@+id/favorite" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@null" 
            android:src="@drawable/btn_favorite" />

    </LinearLayout>
</LinearLayout> 

Good Layout that should be obtained

Bad layout that is currently obtained

  • 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-23T16:19:31+00:00Added an answer on May 23, 2026 at 4:19 pm

    I finally decide to move on and find an other way to solve my problem.

    Everything is now done with xml configuration.

    This is the layout containing the buttons in the bottom part of the screen :

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:orientation="horizontal"
        android:background="@drawable/bg_description"
        android:id="@+id/description_layout"
        >
    

    And here is the bg_description.xml :

    <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle">
            <solid android:color="#919191" />
        </shape>
    </item>
    <item android:top="1dp">
        <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">
                <gradient
                    android:endColor="#525252"
                    android:startColor="#1B1B1B"
                    android:angle="90"/>
        </shape>
    </item>
    

    Everything is perfect now. The background is well displayed, the rendering is better than with the png and the there are not resizing problems anymore.

    Tiled backgrounds are good but for simple use cases like this one, we have to consider better and simpliest solutions through the xml configuration.

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

Sidebar

Related Questions

I have the following Layout which does not work: <LinearLayout android:orientation=horizontal android:layout_width=match_parent android:id=@+id/experienceLayout android:background=#ffffff
I have the following layout: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/aussie_bg_big > <ImageView android:id=@+id/titleImage android:layout_width=wrap_content
This is maddening. I have the following XML layout: <FrameLayout android:layout_width=fill_parent android:layout_height=wrap_content android:background=@drawable/shadow android:focusable=true
I have the following layout: <?xml version=1.0 encoding=utf-8?> <RelativeLayout android:id=@+navigate/RLayout android:layout_width=fill_parent android:layout_height=fill_parent android:background=#ABABAB xmlns:android=http://schemas.android.com/apk/res/android
i have created following layout. <TableLayout android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal > <TableRow> <TextView android:layout_width=fill_parent android:layout_height=wrap_content
I have the following layout: <Grid Width=1024 Height=768 Background={StaticResource WindowBackground} > <Grid.RowDefinitions> <RowDefinition Height=*></RowDefinition>
I have following layout: 4 rounded corners background and two panels (left panel and
I want to have the following layout: (i.e. jbutton and jlabel are placed at
I have the following layout for my mvc project: /Controllers /Demo /Demo/DemoArea1Controller /Demo/DemoArea2Controller etc...
I have the following layout defined for one of my Activities: <?xml version=1.0 encoding=utf-8?>

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.