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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:31:42+00:00 2026-05-28T07:31:42+00:00

I created a field of buttons in my XML file: <RelativeLayout…> <Button android:id=@+id/button_1 …

  • 0

I created a field of buttons in my XML file:

<RelativeLayout...>
<Button  
    android:id="@+id/button_1"
    ...
    />
<Button  
    android:id="@+id/button_2"
    android:layout_toRightOf="@+id/button_1"  
...
/>
...
</RelativeLayout>enter code here

Now I want to abolish the XML rule “toRightOf” programmaticaly.
I know how to set rules:

RelativeLayout.LayoutParams params = null;
params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.RIGHT_OF, topIcon.getId());
button_2.setLayoutParams(params);

But I want to DELETE rules I had set in XML file.
How can this be done?

The background of my question: I used an XML file to easily
create field of buttons.
But later I want to drag and drop buttons.
For that I have to delete rules like “toRightOf”.
Otherwise instead of one button a lot of buttons
move if I only want to move one button.

  • 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-28T07:31:43+00:00Added an answer on May 28, 2026 at 7:31 am

    Looking at this question, it cannot be removed but instead you set the value to 0:

    layoutParams.addRule(RelativeLayout.RIGHT_OF, 0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create xml file. I have three text fields and one button
In Blackberry I have created a horizontal field manager and added some buttons of
I have created a text field component with an 'x' button inside that will
I've a table with a datetime (format: 'Y-m-d H:i:s') 'created' field and 'amount' (integer)
I created a field in my table and set it as the index but
I'm using rails 2.3.4 When I execute rake db:test:prepare the id field created is
Here is my table in the dataset: SELECT tag_work_field.* FROM tag_work_field I created this
We have created a table with a trigger that updates a ModifiedDate field in
I've created a javascript function that allows me to validate if one field or
If I have a datetime field, how do I get just records created later

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.