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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:46:16+00:00 2026-05-27T11:46:16+00:00

I want a Layout like this: But my code doesn’t work. I can’t achieve

  • 0

I want a Layout like this:
Desired layout

But my code doesn’t work. I can’t achieve this Layout, and I don’t know what is wrong with what I’ve done so far.

Here’s what I have so far — Is the layout_gravity OK? Or does it need to be set it in the RelativeLayout?

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

    <RelativeLayout     
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical">

        <TextView
            android:id="@+id/topText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20dip"
            android:layout_gravity="top" />

        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/centerLayout"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="horizontal"
            android:layout_below="@id/topText">     

            <ImageButton
                android:id="@+id/lektionBackButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"

                android:src="@drawable/back"
                android:layout_gravity="left"/>  
            <ImageView
                android:id="@+id/centerImage"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:cropToPadding="true"
                android:layout_gravity="center"/>
            <ImageButton 
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/lektionForwardButton"
                android:src="@drawable/forward"
                android:layout_gravity="right"/>        
         </LinearLayout>    

         <TextView
            android:id="@+id/bottomText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20dip"
            android:layout_below="@id/centerLayout"
            android:layout_gravity="bottom" />
    </RelativeLayout>
</RelativeLayout>
  • 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-27T11:46:17+00:00Added an answer on May 27, 2026 at 11:46 am

    You don’t need to use gravity or the inner LinearLayout at all for this. Instead use layout_alignParentTop, layout_alignParentLeft, layout_alignParentRight, layout_alignParentBottom, layout_centerInParent and layout_centerVertical on the children.

    It might be useful for you to go through the RelativeLayout tutorial.

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

Sidebar

Related Questions

I want to code a simple form layout in flex. Something like the following:
Typically I have to write layout code like this: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical
Below is my code that works fine on IE 8 but it doesn't work
i want to bulid a table layouts like this.how? alt text http://privateevent.co.uk/underground/img/gallery/19_1236343602.png
I want to create separate folders for my layouts, like this in my resource
First let me tell you what I want to achieve. I want a layout
I want to use WebKit as the layout/rendering engine, and I want to code
The spark panel component for example can be written like this <Panel title=Skinny> <child
I have a layout that looks like this: It's a table with one cell
I want to create list view just like this: http://dl.maximumpc.com/galleries/androidpower/Alarm_full.jpg I need to create

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.