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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:52:31+00:00 2026-06-09T02:52:31+00:00

I have an ImageView aligned to the parent right in a relativeLayout. Here is

  • 0

I have an ImageView aligned to the parent right in a relativeLayout.

Here is my layout:

<RelativeLayout android:id="@+id/row" android:background="@null" style="@style/ListRow"
  xmlns:android="http://schemas.android.com/apk/res/android">

    <TextView android:textStyle="bold" android:textColor="@color/primary_text" android:text="Username" android:gravity="center_vertical" android:id="@+id/username" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_toLeftOf="@id/avatar" />

    <LinearLayout android:gravity="center_vertical" android:id="@+id/time_item" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@id/username" android:layout_alignBottom="@id/username" android:layout_alignParentLeft="true">
        <TextView android:textSize="@dimen/font_size_small" android:text="12:00AM" android:textColor="@color/secondary_text" android:gravity="center_vertical" android:id="@+id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" />
    </LinearLayout>

    <RelativeLayout android:id="@+id/avatar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5.0dip" android:layout_alignParentRight="true">
        <ImageView android:id="@+id/picture" android:src="@drawable/ic_launcher" android:layout_width="48.0dip" android:layout_height="48.0dip" android:scaleType="center" android:adjustViewBounds="true" />
        <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" />
    </RelativeLayout>

    <TextView android:textSize="@dimen/font_size_small" android:text="aslkndalskndlaksndlaskndlaksnlansldnaslkndalsdnaslkdnls" android:textColor="@color/primary_text" android:id="@+id/body" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_toLeftOf="@id/avatar" android:layout_below="@id/username" android:lineSpacingMultiplier="1.2" />

</RelativeLayout>

Here is what it looks like:

getting

When starting a new line of text I want the text to align on to the right instead of the left. I have photoshopped what I want. Here is what I want:

want

Anyone know how I should modify my layout to where it does this? Thanks!

  • 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-09T02:52:32+00:00Added an answer on June 9, 2026 at 2:52 am

    Just add one more property in your TextView body.

    android:gravity="right"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this ImageView in my layout: <ImageView android:layout_width=fill_parent android:layout_height=wrap_content android:contentDescription=@string/image_divider android:paddingBottom=8dp android:paddingTop=4dp android:scaleType=fitXY
I have an layout <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=fill_parent android:background=#FFFFFF> <TextView
My layout have ImageView(iv) and TextView(tv). I want to let the tv right of
I have a relative layout that has an ImageView and and a textview aligned
I have this ImageView block inside a Relative layout: <ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignParentBottom=true android:layout_marginBottom=50dip
I have imageView inside a relative layout. And when i create the activity i
I have an imageView and I am basically trying to make a thermometer style
I have a layout containing two textViews and one ImageView. the first text is
I have an ImageView <ImageView android:id=@+id/auto android:layout_width=wrap_content android:layout_height=wrap_content android:layout_margin=10sp android:src=@drawable/auto /> How can I
I have a layout with two ImageView inside. Each image has a fixed aspect

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.