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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:13:05+00:00 2026-05-30T23:13:05+00:00

I have a LinearLayout that has 3 layouts at the top. (So the grey

  • 0

I have a LinearLayout that has 3 layouts at the top. (So the grey bar at the top is split into 3 pieces) Each will have a button in them. I only have 2 with buttons in them at the moment.

This is what it should look like (imagine another button at the top right) The top bar with the buttons in it is 60dp high:

enter image description here

And I want to have a LinearLayout under it. But when I add one and set it at

android:layout_marginTop="60dp"

Thinking it would just set itself under the top grey bar, it moves the middle layout over. The third layout is all the way off the screen.

Like so:

enter image description here

But I want it to look like this (sorry for my lack of MS Paint skills):

enter image description here

So how do I set it so the LinearLayout on the bottom doesn’t interfere with the Layouts above it?

XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:baselineAligned="true"
android:orientation="horizontal" >

<LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="120dp"
    android:layout_height="60dp"
    android:background="@drawable/topbar"
    android:orientation="vertical" >

    <ImageButton
        android:id="@+id/imageButton2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/camerabuttonmew"
        android:background="@null"
        android:layout_margin="5dp" />

</LinearLayout>



<LinearLayout
    android:id="@+id/LinearLayout02"
    android:layout_width="120dp"
    android:layout_height="60dp"
    android:background="@drawable/topbar"
    android:orientation="vertical" >


    <ImageButton
        android:id="@+id/imageButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:background="@null"
        android:src="@drawable/homebuttonnew"
        android:layout_margin="5dp" />

</LinearLayout>

<LinearLayout
    android:id="@+id/linearLayout2"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:background="@drawable/topbar" >
</LinearLayout>

<LinearLayout
    android:id="@+id/linearLayout3"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_marginTop="60dp" >
</LinearLayout>
  • 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-30T23:13:07+00:00Added an answer on May 30, 2026 at 11:13 pm

    Have you considered using a Relative Layout and with the images at the top and the LinearLayout under it. A helpful tutorial, http://www.higherpass.com/Android/Tutorials/Exploring-Android-Linearlayout-And-Relativelayout/

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

Sidebar

Related Questions

I have a layout that is three linear layouts. The top has some icons
I have a View that inherits from LinearLayout that inflates itself. After it has
I have a vertically oriented LinearLayout that has a child LinearLayout that includes a
I have a LinearLayout that I've styled to look like a button , and
I have a custom ListItem row that has a TextView on the top and
I'm trying to make a LinearLayout that has three rows, each of equal height.
This makes no sense. I have some code that has a simple LinearLayout and
I need to have a layout that has a view above a set of
I have a LinearLayout which has a background image (a 9 patched png file).
I have a fragment which has its own state (selected buttons, etc). That state

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.