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

  • Home
  • SEARCH
  • 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 6147557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:07:24+00:00 2026-05-23T19:07:24+00:00

I did like below in xml <TableRow> <TextView android:id=@+id/address1 android:layout_width=fill_parent android:layout_height=wrap_content android:gravity=left android:maxLines=4 android:singleLine=false

  • 0

I did like below in xml

<TableRow>
    <TextView android:id="@+id/address1"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"
        android:gravity="left"
        android:maxLines="4" 
        android:singleLine="false"              
        android:text="Johar Mor, Gulistan-e-Johar, Karachi" >
    </TextView> 
</TableRow>

It is not working for multiline, and I am using TableLayout…

so what is mistake I am doing here?

  • 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-23T19:07:24+00:00Added an answer on May 23, 2026 at 7:07 pm

    If the text you’re putting in the TextView is short, it will not automatically expand to four lines. If you want the TextView to always have four lines regardless of the length of the text in it, set the android:lines attribute:

    <TextView
        android:id="@+id/address1"
        android:gravity="left"
        android:layout_height="fill_parent"
        android:layout_width="wrap_content"
        android:maxLines="4"
        android:lines="4"
        android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."></TextView>
    

    You can do this with TableRow, see below code

    <TableRow >
            <TextView
                android:id="@+id/tv_description_heading"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="left"
                android:padding="8dp"
                android:text="@string/rating_review"
                android:textColor="@color/black"
                android:textStyle="bold" />
    
            <TextView
                android:id="@+id/tv_description"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="left"
                android:maxLines="4"`enter code here`
                android:padding="8dp"
                android:text="The food test was very good."
                android:textColor="@color/black"
                android:textColorHint="@color/hint_text_color" />
        </TableRow>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using C# and .NET 2.0. Given the XML below, I'd like to get
I did a test like below ↓ 1) Create a customer enum (copy from
I did a exercise like this, how do I calculate the # of XML
I have an xml file which looks like the below example <Ids> <Id> <set>ai</set>
I searched and found this question but did not like the answer. Is there
I was writing a metaclass and accidentally did it like this: class MetaCls(type): def
**Nevermind. I figured it out. ** I did it like this: $(#accordion).accordion({ header:'h3', active:
i like to setup for my project i did my project in Microsoft visual
Seems like it would be better if you did commit followed by merge. I'm
I did some timing tests and also read some articles like this one (last

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.