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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:27:33+00:00 2026-06-12T16:27:33+00:00

I have a TableLayout and I need to add TableRows at runtime. I need

  • 0
  1. I have a TableLayout and I need to add TableRows at runtime.
  2. I need to add an ImageView and a TextView to each TableRow and add the row to TableLayout.
  3. And the TextView added to each row should be displayed in multiple lines if the length of the text is much long.
  4. I tried setSingleLine(false), setMaxWidth(100), setMaxLines(3), nothing is working but If I add the TableRow in xml with android:singleLine=”false” it shows the text in multiple lines.

Please suggest me…….

SOLVED THROUGH THIS CODE

TableRow.LayoutParams tlparams = new TableRow.LayoutParams(
TableRow.LayoutParams.WRAP_CONTENT,
TableRow.LayoutParams.WRAP_CONTENT);
TextView textView = new TextView(this);
textView.setLayoutParams(tlparams);
textView.setText("New text: " + s);
textView.setSingleLine(false);
  • 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-12T16:27:34+00:00Added an answer on June 12, 2026 at 4:27 pm

    The below code will work for you.

    TableRow.LayoutParams tlparams = new TableRow.LayoutParams( 
    TableRow.LayoutParams.WRAP_CONTENT, 
    TableRow.LayoutParams.WRAP_CONTENT); 
    TextView textView = new TextView(this); 
    textView.setLayoutParams(tlparams); 
    textView.setText("New text: ");
    textView.setMaxLines(3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tablelayout in Android like this: 1) Row == IMAGEVIEW | TEXTVIEW
Basically I have a TableLayout with several TableRows, each containg 5 cells (Name, Price,
I have a TableLayout in my app, which I need to define and add
I have a working dynamic TableLayout that holds user data. Clicking an Add Event
I have a Button that adds a row with an EditText to a TableLayout
I need to have an edit option in tableLayout just like in iphone UITableView
I have a List of TableLayout's that are each generated from data in my
I need to have a fixed row with a scrolling area below it filled
I have a cusom view derived from TableLayout, and I need to declare String
I have method in my Activity, which should add items from the webservice if

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.