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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:48:03+00:00 2026-06-11T08:48:03+00:00

I am trying to fit TextViews in the screen, so that every textview contains

  • 0

I am trying to fit TextViews in the screen, so that every textview contains 1 word of a long sentence.

This is a very long sentence, so long that it does not
fit in the screen.

Here fit in the screen are 4 textviews, which I need to move to the next line. Basically, this way I can get click events for each word (since I need to support Android 2.2, and Spannable needs getX and getY that 2.2 does not support).

Layout

         <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:fitsSystemWindows="true"
            android:orientation="horizontal" >

            <TextView
                android:id="@+id/word1"
                style="@style/select_part_of_speech_word" />

            <TextView
                android:id="@+id/word2"
                style="@style/select_part_of_speech_word" />
..... more TextViews.....
            <TextView
                android:id="@+id/word15"
                style="@style/select_part_of_speech_word" />
        </LinearLayout>

Style applied

<style name="select_part_of_speech_word" parent="@android:style/TextAppearance.Medium">
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:layout_marginBottom">10dp</item>
    <item name="android:layout_marginTop">10dp</item>
    <item name="android:text">@string/randomTutorialText</item>
    <item name="android:textColor">@android:color/black</item>
    <item name="android:textSize">25sp</item>
    <item name="android:visibility">visible</item>
    <item name="android:lines">1</item>
</style>

With this, the textviews just seem to disappear. I guess if I use a horizontal scrollview, I will be able to view all 15 textviews, but I need them to overflow to the next available space below. Can this be done ?

  • 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-11T08:48:04+00:00Added an answer on June 11, 2026 at 8:48 am

    So you want something equivalent to a FlowLayout.

    You could try Romain Guy’s implementation.

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

Sidebar

Related Questions

I am trying to fit a sentence that changes often, in to a few
I'm not sure how to explain this. So here goes... I'm trying to fit
I'm trying to fit an image into a <td> that is smaller than the
I'm trying to make a textview that scales the contents so that it all
Im trying to fit a swimming pool onto this piece of terrain. The terrain
I am trying to fit two CheckBoxes into a single TableRow , so that
I am trying to curve fit some periodical experimental data, and discovered that the
I'm trying to put a TextView into my TableView so that it doesn't push
I'm trying to create this simple layout in Android. A should wrap to fit
I'm trying to fit some data to a lognormal distribution and from this generate

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.