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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:41:05+00:00 2026-06-15T17:41:05+00:00

I want to show two buttons in a way that one button should align

  • 0

I want to show two buttons in a way that one button should align to the left side of the screen and the other one should align to right side of the screen in same horizontal line. Settings button has aligned to the left but i am not able to right align About button. Here is the activity xml layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainPageActivity"

 >

<RelativeLayout
    android:id="@+id/relativeLayout1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="95dp"
    android:layout_marginTop="96dp" >
</RelativeLayout>

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/relativeLayout1"
    android:layout_alignParentLeft="true"
    android:layout_marginLeft="24dp"
    android:text="@string/welcomeText"
    android:textAppearance="?android:attr/textAppearanceLarge"
    />



<Button android:text="Find out Now!" 
    android:id="@+id/button1" 
    android:background="@drawable/selectbutton" 
    style="@style/FindOutButtonStyle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/textView1"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="54dp"/>

<Button android:text="Settings" 
    android:id="@+id/button2" 
    android:background="@drawable/selectbutton" 
    style="@style/SettingsButtonStyle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/button1"
    android:layout_marginTop="204dp"/>

<Button android:text="About" 
    android:id="@+id/button3" 
    android:background="@drawable/selectbutton" 
    style="@style/AboutButtonStyle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/button1"
    android:layout_toRightOf="@+id/button2"
    android:layout_marginTop="204dp"/>


</RelativeLayout>

strings.xml:

<style name="FindOutButtonStyle">
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:textColor">#ffffff</item>
    <item name="android:gravity">center</item>
    <item name="android:layout_margin">3dp</item>
    <item name="android:textSize">30dp</item>
    <item name="android:textStyle">bold</item>
    <item name="android:shadowColor">#000000</item>
    <item name="android:shadowDx">1</item>
    <item name="android:shadowDy">1</item>
    <item name="android:shadowRadius">2</item>
</style>

<style name="SettingsButtonStyle">
    <item name="android:layout_width">60dp</item>
    <item name="android:layout_height">50dp</item>
    <item name="android:textColor">#ffffff</item>
    <item name="android:gravity">left</item>
    <item name="android:layout_margin">3dp</item>
    <item name="android:textSize">20dp</item>
    <item name="android:textStyle">bold</item>
    <item name="android:shadowColor">#000000</item>
    <item name="android:shadowDx">1</item>
    <item name="android:shadowDy">1</item>
    <item name="android:shadowRadius">2</item>
</style>

<style name="AboutButtonStyle">
    <item name="android:layout_width">60dp</item>
    <item name="android:layout_height">50dp</item>
    <item name="android:textColor">#ffffff</item>
    <item name="android:gravity">right</item>
    <item name="android:layout_margin">3dp</item>
    <item name="android:textSize">20dp</item>
    <item name="android:textStyle">bold</item>
    <item name="android:shadowColor">#000000</item>
    <item name="android:shadowDx">1</item>
    <item name="android:shadowDy">1</item>
    <item name="android:shadowRadius">2</item>
</style>

selectbutton.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
    <shape>
        <solid
            android:color="#449def" />
        <stroke
            android:width="1dp"
            android:color="#2f6699" />
        <corners
            android:radius="3dp" />
        <padding
            android:left="10dp"
            android:top="10dp"
            android:right="10dp"
            android:bottom="10dp" />
    </shape>
</item>
<item>
    <shape>
        <gradient
            android:startColor="#449def"
            android:endColor="#2f6699"
            android:angle="270" />
        <stroke
            android:width="1dp"
            android:color="#2f6699" />
        <corners
            android:radius="4dp" />
        <padding
            android:left="10dp"
            android:top="10dp"
            android:right="10dp"
            android:bottom="10dp" />
    </shape>
</item>
</selector>

Here is the output of above code:

enter image description here

I want to place About button to right side of the screen. Please help.

  • 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-15T17:41:05+00:00Added an answer on June 15, 2026 at 5:41 pm

    add android:layout_alignParentRight="true" to the about button

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

Sidebar

Related Questions

My ListView item has two TextViews. I want to show one of them at
I have an app that has two buttons – one for email & one
I have a div that I want to show/hide when clicking a button. The
I have a wpf application. I want to show two images on two buttons
So I have two users a mentor and a mentee. I want to show
I want to open an inbuilt google map intent to show route between two
I want show annotation view (above one of my pin) after load map. For
I want to show a welcome screen as well as some basic tutorials of
can some one show me how to hide/show tray icons of other applications/processes using
I have a form that I want to present in two states: 1) Normal

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.