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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:54:48+00:00 2026-05-26T00:54:48+00:00

Im trying to figure out how to align a view in relative layout to

  • 0

Im trying to figure out how to align a view in relative layout to its top right corner.
Currently it is aligned in top left corner.

A simple problem, yet I dont know how to do it.

Here is the code:

        RelativeLayout.LayoutParams gpsViewLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT );
    gpsViewLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
    gpsViewLayoutParams.addRule(RelativeLayout.ALIGN_RIGHT);
    this.relativeLayout.addView(gpsView,gpsViewLayoutParams); 
  • 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-26T00:54:49+00:00Added an answer on May 26, 2026 at 12:54 am

    Use this:

    gpsViewLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
    

    instead of

    gpsViewLayoutParams.addRule(RelativeLayout.ALIGN_RIGHT); 
    

    You may get in this way.

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

Sidebar

Related Questions

I'm trying to figure out how to align the images (top right buttons) in
Im trying to figure this out, please consider these styles: .text_left { text-align:left; }
I am currently trying to figure out an way to vertically align an div
Trying to figure out why my silverlight app suddenly just displays nothing (right click
Im going mad trying to figure out why the title link (in the left)
I am trying to have some LIs within a UL align left, right, and
I'm trying to figure out a way how to align tasks in a thread
I'm currently trying to right align the logging level field in my Python logger
I am currently trying to write a simple shoot them up game with top
Hi I've been trying to figure out if its even possible to take 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.