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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:22:16+00:00 2026-05-22T18:22:16+00:00

I have the following linearlayout for a listitem. <ImageView android:id=@+id/icon android:src=@android:drawable/ic_input_add android:layout_height=wrap_content android:layout_width=22px android:layout_marginTop=4px

  • 0

I have the following linearlayout for a listitem.

    <ImageView android:id="@+id/icon" 
                   android:src="@android:drawable/ic_input_add"  
                   android:layout_height="wrap_content"  
                   android:layout_width="22px"  
                   android:layout_marginTop="4px"  
                   android:layout_marginRight="4px"  
                   android:layout_marginLeft="1px" />

    <LinearLayout android:id="@+id/linearLayout1"  
                      android:orientation="vertical"  
                      android:layout_height="wrap_content" 
                      android:layout_width="wrap_content">

        <TextView android:layout_width="wrap_content"  
                      android:text="LongerTextView" 
                      android:id="@+id/textView1" 
                      android:layout_height="wrap_content"/>

        <TextView android:layout_width="wrap_content" 
                      android:text="TextView" 
                      android:id="@+id/textView2" 
                      android:layout_height="wrap_content"/>

    </LinearLayout>

    <LinearLayout android:id="@+id/linearLayout2" 
                      android:layout_height="match_parent"  
                      android:layout_width="fill_parent" 
                      android:gravity="right">

        <ImageView android:layout_marginTop="4px" 
                       android:src="@android:drawable/ic_input_add"    
                       android:layout_marginLeft="1px"  
                       android:layout_height="wrap_content"   
                       android:layout_marginRight="1px" 
                       android:id="@+id/icon2" 
                       android:layout_width="22px"/>
    </LinearLayout>

The layout is supposed to show an image on the left and all the way on the right, with two text items between. This works fine, as long as the text does not become wider than screen. As soon as the text is longer my right icon gets pushed off the screen.

The text is supposed to wrap to a new line and both the left and right icon are supposed to always show.

How can I achieve this?

  • 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-22T18:22:16+00:00Added an answer on May 22, 2026 at 6:22 pm

    Try to use Relative Layouts

    Inside a Relative Layout, you can specify an image (with id: imgLeft for example) with layout_alignParentLeft=”true”, that will stay on the left

    Then another image (imgRight) with layout_alignParentRight=”true”, that will stay on the right

    and then the linear layout containing the texts with:
    layout_toLeftOf=”@id/imgRight” and layout_toRightOf=”imgLeft”

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

Sidebar

Related Questions

I have the following ImageView and TextView: Here is the XML: <LinearLayout android:layout_height=wrap_content android:layout_width=match_parent
I have the following layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=horizontal> <ImageView android:id=@+id/movie_icon android:src=@drawable/star_off android:layout_height=wrap_content
I have the following XML layout: <LinearLayout android:id=@+id/map_locations_list android:layout_width=300dp android:layout_height=fill_parent android:layout_marginLeft=8dp android:layout_marginTop=8dp android:layout_marginBottom=8dp android:background=@color/black_shadow
hi i have the following xml layout <Button android:id=@+id/signupButton android:layout_gravity=left android:layout_width=100sp android:layout_height=wrap_content android:layout_marginLeft =
Have the following view in my app: <TabHost xmlns:android=http://schemas.android.com/apk/res/android android:id=@android:id/tabhost android:layout_width=fill_parent android:layout_height=fill_parent> <LinearLayout android:orientation=vertical
I have the following basic layout <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent> <LinearLayout android:orientation=horizontal android:layout_width=fill_parent
I have the following Layout which does not work: <LinearLayout android:orientation=horizontal android:layout_width=match_parent android:id=@+id/experienceLayout android:background=#ffffff
I have the following XML layout for a ListActivity. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have following layout in my android application. <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/mainlayout android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent
I have the following View setup in one of my Activities: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/photoLayout

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.