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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:14:16+00:00 2026-06-03T08:14:16+00:00

I have a LinearLayout and I amdynamically creating a certain number of TextViews in

  • 0

I have a LinearLayout and I amdynamically creating a certain number of TextViews in it.
Sometimes there are more TextViews than fit on the screen.

How do I add a scrollbar to this view, so the user can scroll up and down and see all TextViews?

Here’s part of my code:

LinearLayout layout = (LinearLayout) findViewById(R.id.layout);
for (int n = 0; n < (numberOfPlayers*(numberOfPlayers-1)/2); n++) {
    TextView tv = new TextView(this);
    tv.setText(gamelist[n][0] + " - " + gamelist[n][1]);
    layout.addView(tv);
}
  • 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-03T08:14:18+00:00Added an answer on June 3, 2026 at 8:14 am

    Include your linearLayout in a ScrollView

    <ScrollView 
       android:id="@+id/scroll"
       android:layout_height="wrap_content" 
       android:layout_width="wrap_content">
    
        <LinearLayout ... />
    
    </ScrollView>
    

    Note that a ScrollView can only have one view child

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

Sidebar

Related Questions

I have an empty LinearLayout , and I need to add a dynamic number
I have multiple textviews in main.xml <LinearLayout... > <textview adndroid:tag=A> ... till to Z.
There is one image on LinearLayout. I have to move that image in any
I have a simple LinearLayout. When I add the android:background to the LinearLayout, the
I have a custom component which extends LinearLayout, I need to execute certain statements
I have a LinearLayout which contains only a ListView. LinearLayout fills the entire screen
I have a LinearLayout in my xml. On runtime i add one image view
I have a LinearLayout that I am extending and I want to add a
I have a LinearLayout with some nested LinearLayouts, ImageView's and TextViews. One of the
I have a LinearLayout view that I am trying to add a divider to

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.