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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:54:44+00:00 2026-05-27T10:54:44+00:00

I am doing custom layout. But I want to seem like in the screen

  • 0

I am doing custom layout. But I want to seem like in the screen button, image, text.

See Setting parameters on child views of a RelativeLayout .I want to add a button on the left side. Can anybody help me?

My code is:

RelativeLayout.LayoutParams lp1=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
addView(pic,lp1);

RelativeLayout.LayoutParams lp2=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
lp2.addRule(RelativeLayout.RIGHT_OF,pic.getId());
addView(name,lp2);


RelativeLayout.LayoutParams lp3=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
lp3.addRule(RelativeLayout.LEFT_OF,pic.getId());
addView(deletebutton,lp3);

What is wrong?

  • 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-27T10:54:44+00:00Added an answer on May 27, 2026 at 10:54 am

    Look carefully at what you do.

    First, you add “pic” to your layout, which will be aligned with your relative layout on the left side (since you didn’t provide any rules for it).

    At the end, you are trying to add a view at the left side, but there is no space for it, since your pic is left aligned.

    You have couple of ways out.

    1) Add rule for a ‘pic’ to be centered in parent horizontally. The there might be free space on the left to fit button.

    2) Add button first (it will be aligned left), then add pic and set rule to be on the buttons’ right and then add name like you did.

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

Sidebar

Related Questions

Use jquery + php. Doing custom AJAX captcha. i.e user clicks on image, it
We are doing a custom JIRA project now, for the view issues screen, we
I have created a custom Button class and I want to be able to
I am designing a media player with a custom layout. I want the interface
I create a custom image view by extending ImageView that just draws some text
I want to create custom Toast view like public class SMSToast extends Activity {
Can I add new method to aspxclienttextbox control? I'm doing custom control on the
I'm doing some custom animations to change views in a single method. I already
I am doing a custom control (inherited from VisualBasic.PowerPacks.LineShape ), that should be painted
So I am doing some custom animations on my navigationcontroller and the way it

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.