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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:37:18+00:00 2026-06-14T21:37:18+00:00

I have a RelativeLayout inside a LinearLayout which I use to display some data:

  • 0

I have a RelativeLayout inside a LinearLayout which I use to display some data:

<LinearLayout
    android:id="@+id/linearLayout4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginRight="3dp"
    android:layout_marginTop="3dp"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="3dp"
        android:ellipsize="end"
        android:maxLines="1"
        android:textSize="16dp"
        android:textStyle="bold" />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_vertical"
            android:singleLine="true" />

        <ImageView
            android:id="@+id/uhr"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:layout_gravity="left"
            android:layout_marginLeft="2dp"
            android:layout_toRightOf="@id/time"
            android:src="@drawable/event_clock" />
    </RelativeLayout>

    <TextView
        android:id="@+id/description"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="3dp"
        android:autoLink="web|email"
        android:textSize="14dp" />
</LinearLayout>

The problem is that I want my ImageView to the left and the TextView right beside it.
If I however change android:layout_toRightOf="@id/time" to android:layout_toLeftOf="@id/time" It only shows the TextView but the ImageView dissapears.

  • 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-14T21:37:20+00:00Added an answer on June 14, 2026 at 9:37 pm

    Just put the layout_toRightOf on the TextView then:

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    
        <TextView
            android:id="@+id/time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/uhr"
            android:gravity="center_vertical"
            android:singleLine="true" />
    
        <ImageView
            android:id="@+id/uhr"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:layout_gravity="left"
            android:layout_marginLeft="2dp"
            android:src="@drawable/event_clock" />
    </RelativeLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have TextView in RelativeLayout, which works properly: <TextView android:id=@+id/tv_client_in android:layout_width=wrap_content android:layout_height=wrap_content android:layout_above=@+id/tv_label_client_out android:layout_alignParentLeft=true
I have the following code in my XML file: <LinearLayout android:layout_width=fill_parent android:layout_height=60dip android:layout_marginLeft=13dp android:layout_marginRight=13dp
I have this layout: <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content android:layout_gravity=center android:cacheColorHint=#0000 android:background=@layout/selectorgreybutton > <LinearLayout android:orientation=horizontal
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 EditText in my XML as <!-- Inside RelativeLayout --> <EditText android:id=@+id/edtEmail android:layout_width=match_parent
I have a some ui widgets including textview inside RelativeLayout which is clickable. My
Here's a layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical> <RelativeLayout android:id=@+id/first_tv_container android:layout_width=fill_parent android:layout_height=wrap_content android:focusable=true android:background=@android:drawable/list_selector_background>
I have row for ListView(listview is inside LinearLayout) like <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
I have LinearLayout inside of RelativeLayout. I would like to change height of LinearLayout
In my foo_layout.xml file I have a subclassed RelativeLayout: <?xml version=1.0 encoding=utf-8?> <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android

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.