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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:53:54+00:00 2026-06-12T20:53:54+00:00

I seem to be having trouble using relative links to display buttons. They stick

  • 0

I seem to be having trouble using relative links to display buttons. They stick together, like buttons overriding each other, and I’ve tried to get them to not stick, but to no avail.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:background="@drawable/formation"
android:layout_height="fill_parent" >

<Button
    android:layout_weight="1.0"
    android:layout_gravity="bottom"
    android:layout_alignParentTop="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/Laws" />
<Button 
    android:layout_weight="1.0"
    android:layout_gravity="bottom"
    android:layout_alignParentTop="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Qualifications of a naval officer" />
<Button
    android:layout_weight="1.0" 
    android:layout_gravity="bottom"
    android:layout_alignParentTop="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Code of Conduct" />
</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-06-12T20:53:55+00:00Added an answer on June 12, 2026 at 8:53 pm

    while creating any xml file, keep in mind that every widget is unique by its id, so first of all you have to assign id to each widget.

    Now, here you are using Relative Layout. so every widget you added here will relate to each other.

    Now see this code, i did change in your code.

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
       xmlns:tools="http://schemas.android.com/tools"
       android:layout_width="fill_parent"
       android:background="@drawable/formation"
       android:layout_height="fill_parent" >
    
    <Button
    android:id="@+id/btn1"
    android:layout_weight="1.0"
    android:layout_gravity="bottom"
    android:layout_alignParentTop="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/Laws" />
    <Button 
    android:id="@+id/btn2"
    android:layout_gravity="bottom"
    android:layout_below="@+id/btn1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Qualifications of a naval officer" />
    <Button
    android:id="@+id/btn3"
    android:layout_gravity="bottom"
    android:layout_below="@+id/btn2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Code of Conduct" />
    </RelativeLayout>
    

    So all button will display one by one.

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

Sidebar

Related Questions

I'm having trouble trying to manipulate music using buttons I can't seem to make
I seem to be having a bit of trouble with using classes from other
I seem to be having trouble with the linkify I am using in my
I'm having trouble with some report items changing other items' positions when they are
im having trouble developing using chrome as my preview browser, it doesnt seem to
I'm having trouble using sed to replace non-printable characters with other non-printable characters. Specifically,
I seem to be having some trouble grasping the concept of using AS to
I seem to be having trouble with my code. I need to say: if
This may be something common and trivial, but I seem to be having trouble
I'm having trouble with MySQL or Python and can't seem to isolate the problem.

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.