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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:39:29+00:00 2026-05-31T06:39:29+00:00

I have a horizontal linear layout with an image and a couple text views.

  • 0

I have a horizontal linear layout with an image and a couple text views. In some languages (German…) the text is so long that to fit everything on one line, the layout would have to be wider than the screen. To prevent this, android automatically makes the text views wrap on to the next line.

Is there any way to choose which of the text views will end up wrapping? At the moment it appears that the last view added to the layout is the one that wraps. However I’d really like to have one of the earlier text views wrap and have the last text view always display on a single line. Is this possible? I’ve already subclassed most of the views involved so I can override protected methods.

Heres a rough outline of my code:

<LinearLayout
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:orientation="horizontal">
  <ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/some_icon" />
  <TextView
    android:id="@+id/can_wrap_if_neccessary"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/some_really_long_text" />
  <TextView
    android:id="@+id/shouldnt_wrap"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/some_more_really_long_text" />
</LinearLayout
  • 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-31T06:39:30+00:00Added an answer on May 31, 2026 at 6:39 am

    I figured it out: the solution is to set the layout_weight attribute on the view(s) that I want to wrap, and not set it at all on the views I don’t want to wrap. Any view with a layout_weight will wrap in preference over those without.

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

Sidebar

Related Questions

I have a horizontal linear layout with four image buttons. Each image button has
I have a image and blank linear layout , when i drag button linear
I have 2 images in a horizontal linear layout. I want one to sit
I have a linear layout that contains 6 images, which span the linear layout
I have a set of 10 image views that need to be set on
I have a Horizontal Layout in which some vertical layouts are dispatched. I want
I have an image of some restaurant and under that some info of that
I have a ListView with some custom layout for the row (an image, then
Do you know any controls inherited from the ItemsControl that have horizontal orientation of
i have a that contains a HORIZONTAL menu. the menu consists of an unordered

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.