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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:55:52+00:00 2026-06-03T21:55:52+00:00

I have this header: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent android:padding=5dip> <Button android:id=@+id/home android:layout_width=wrap_content android:layout_height=wrap_content android:text=Home

  • 0

I have this header:

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

 <Button android:id="@+id/home"
  android:layout_width="wrap_content" android:layout_height="wrap_content"
  android:text="Home"
/>

 <Button android:id="@+id/questions"
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"
  android:text="My Questions"
 /> 

<Button android:id="@+id/questions"
 android:layout_width="wrap_content" android:layout_height="wrap_content"
 android:text="Questions"
android:layout_toRightOf="@+id/home"  />  


 <Button android:id="@+id/businesses"
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"
  android:text="Businesses"
android:layout_toRightOf="@+id/businesses"
 />  

 <Button android:id="@+id/learn"
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"
  android:text="Learn"
  android:layout_toRightOf="@+id/learn"
 />  


 <Button android:id="@+id/extra_help"
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"
  android:text="Help"
  android:layout_toRightOf="@+id/learn"
/>  
</RelativeLayout>

and for some reason, the buttons display 50% on top of each other all bunched up, each covering half of the other.

Any idea what is wrong with my layout?

Thanks!

  • 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-06-03T21:55:54+00:00Added an answer on June 3, 2026 at 9:55 pm

    You are using a relative layout, you need to manage both horizontal and vertical alignment. For example, all the android:layout_toRightOf are used for horizontal positioning, you need to also add attributes to handle the vertical positioning.

    All the possible attributes are found here:
    http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html

    UPDATE
    Seeing your comments below, it seems you just want to have one horizontal row. In that case, just make sure each is aligned to the previous one(But then why not use a linear layout?)

    Check your id’s though, and @+id/learn is aligned to the right of itself. Revisit that. And you also have a button right after “Home” that isn’t handled at all.

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

Sidebar

Related Questions

This is the static xml that I have: <LinearLayout android:id=@+id/LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent
I have the following layout in my xml file: <RelativeLayout android:layout_width=fill_parent android:layout_height=fill_parent> <FrameLayout android:id=@+id/logoLayout
i have this header at the top: http://yoursdproperty.com/ how do i move the swf
I have this header file, zeeheader.h, and I wrote some classes in it, I'm
I have this class header //header for class. #ifndef Container_H #define Container_H #include <iostream>
I have this below code and it work fine header (content-type: text/xml); $xml =
I have a macro definition in header file like this: // header.h ARRAY_SZ(a) =
I have a CSS entry that looks like this: .header { background-image: url(./images/embouchure.jpg); background-repeat:
I have a header file. In this header I want to use a map
I have defined a format like this: # header format format STDOUT_TOP = pid

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.