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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:33:40+00:00 2026-05-26T17:33:40+00:00

I have a little issue with setting align of a button in my application.

  • 0

I have a little issue with setting align of a button in my application. I have 4 different buttons in one layout and depending on some values from database I have to set the visibility of one button. Here is the example of xml code which I’m using :

 <RelativeLayout 
    android:id="@+id/coll_buttons"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_gravity="center"
    android:layout_marginBottom="10dp">


  <Button
        android:id="@+id/sync"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Synchronize"
        android:textSize="9dp"
        android:background="@drawable/ic_white_button"
        android:textColor="#333333"
        android:layout_margin="10dp"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:paddingLeft="15dp"
        android:paddingRight="15dp"
        android:layout_alignParentLeft="true" />   

    <Button
        android:id="@+id/activate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Activate"
        android:textSize="9dp"
        android:background="@drawable/ic_white_button"
        android:textColor="#333333"
        android:layout_margin="10dp"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:paddingLeft="15dp"
        android:paddingRight="15dp"
        android:layout_alignParentLeft="true" />

    <Button 
        android:id="@+id/buy_stampii"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Buy Stampii"
        android:textSize="9dp"
        android:background="@drawable/ic_white_button"
        android:textColor="#333333"
        android:layout_marginTop="10dp"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:paddingLeft="15dp"
        android:paddingRight="15dp"
        android:layout_toRightOf="@+id/activate"
        android:layout_marginLeft="5dp" />

    <Button
        android:id="@+id/deactivate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Deactivate"
        android:textSize="9dp"
        android:background="@drawable/ic_white_button"
        android:textColor="#333333"
        android:layout_marginTop="10dp"
        android:layout_marginRight="10dp"
        android:paddingTop="10dp"
        android:paddingBottom="10dp"
        android:paddingLeft="15dp"
        android:paddingRight="15dp"
        android:layout_alignParentRight="true" />

</RelativeLayout>

In the first case I have to set the visibility of Button Activate to false and set the visibility of Button Sync to true. But when I do that my Buy Stampii button is overlaying Sync Button because I’m setting Buy Stampii button toRightOf Activate Button. So is there any way that I can set to Buy Stampii Button toRightOf property for two different buttons or how can I solve that issue?

Thanks a lot!

  • 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-26T17:33:41+00:00Added an answer on May 26, 2026 at 5:33 pm

    NOp I do not think that you can set the toRightOf property pointing to 2 widgets in the same time.

    Yes there is one workaround that you can do. Instead of putting the view to visibility gone , you can put the property to INVISIBLE. in this case if you say A to be to the right of B it will works just fine if the A is VISIBLE. But the problem is when the A is gone, gone means that B would not know where to be placed (to the right of ‘nothing’ cause A is gone). The trick is to put the A to be INVISIBLE. in this case you can still say B to be the right of A and the B will know where to be placed.

    The drawback is that when A is invisible the place will still be occupied but you can easily solve this issue with playing with the size of the layout. For example when INVISIBLE you can set the width to 1dip and when VISIBLE you can set to wrap_content or what ever that suit you

    This works I have tried ones but the solution is UGLY and basically you shouldn’t do workaround like this.

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

Sidebar

Related Questions

I have a little issue with setting an image to a list view using
I have a little issue concerning an animation-effect which loads a certain div into
Hey guys I have a little issue here. I have a panel where I
im having a little issue here. I have MediaElement.js set on my project. It
I have a little problem with javascript form submit issue, here is the script
I have little issue with detecting internet connection while using static IP on device.
I have a little issue on what sequence things are being called when adding
You can see in this page: http://www.indiacustomercare.com/blogs/admin there is layout issue for some time
I have an issue that on one computer applications developed using the Windows Presentation
I have a little weird behavior with my ASP.NET MVC 2 application. I'm using

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.