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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:57:24+00:00 2026-06-08T00:57:24+00:00

I thought I understood XML. <?xml version=1.0 encoding=utf-8?> <Button android:id=@+id/button1 android:layout_width=109dp android:layout_height=wrap_content android:layout_gravity=left android:clickable=true

  • 0

I thought I understood XML.

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

<Button
    android:id="@+id/button1"
    android:layout_width="109dp"
    android:layout_height="wrap_content"
    android:layout_gravity="left"
    android:clickable="true"
    android:onClick="closelog"
    android:text="@string/close"
     />



 <Button
    android:id="@+id/sendLogButton"
    android:layout_width="109dp"
    android:layout_height="wrap_content"
    android:layout_gravity="right"
    android:clickable="true"
    android:onClick="sendLog"
    android:text="@string/sendLog" />

<ListView
    android:id="@+id/loglist"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >
</ListView>

My buttons are not in the correct place on my layouts. Can someone explain to me why my two buttons can’t occupy the same horizontal row when they are both the children of the same relative layout.
enter image description here

  • 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-08T00:57:25+00:00Added an answer on June 8, 2026 at 12:57 am

    You need to wrap the buttons in a relative layout and then use attributes like android:layout_toRightOf="@id/anid and android:layout_toLeftOf="@id/anid to align the buttons to your liking. You also need to delete the layout_gravity.

    See this post for more details on align elements in XML.

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

Sidebar

Related Questions

I thought I have understood the XML layout of Android, but it seems that
I thought I understood sed but I guess not. I have the following two
I really thought I understood Python variable referencing, so I'm confused why this code
Being a newbie I thought I understood what to do from a security standpoint
I don't claim to know anything about svn, but I thought I understood how
After I thought that I've understood how they work, I tried this: NSString *str1
I'm trying to read in an xml file which looks like this <?xml version=1.0
This is relating to UTF-8, PHP and XML Mysql , which I am still
I'm just beginning to experiment with Android Development with SimpleXML and thought it was
I may not understand what the return statement does(I thought it just returned a

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.