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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:15:25+00:00 2026-06-05T23:15:25+00:00

I am trying to design a listview with 3 textViews within it. 1 textview

  • 0

I am trying to design a listview with 3 textViews within it. 1 textview is for author, 2nd for date and the last one is for the comment. But I am having some problems with the layout and I am not a monster in XML. So I do need some advice. This is what my list looks like atm: http://tinypic.com/view.php?pic=357khhj&s=6

As you can see, whenever someone types more then a couple of words (like jesper’s comment) everything looks awful. Any tips how I can fix this without the rows gets all f`ked up like in the picture?. Also I only want to be able to display 2 rows of text in the comment eventhough the person actualy types, lets say 10 rows as an example. Thanx!

Here is the xml code:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffffff" >

<TableLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:stretchColumns="1"
    android:weightSum="1.0" >

    <TableRow>

        <TextView
            android:id="@+id/feedback_list_item_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            android:layout_weight="0.8"
            android:gravity="left"
            android:shadowColor="#bdbebd"
            android:shadowDx="1.0"
            android:shadowDy="1.0"
            android:shadowRadius="0.5"
            android:text="Unknown"
            android:textColor="#000000"
            android:textSize="16dp"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/feedback_list_item_time"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginRight="5dp"
            android:layout_marginTop="5dp"
            android:layout_weight="0.2"
            android:gravity="right"
            android:shadowColor="#bdbebd"
            android:shadowDx="1.0"
            android:shadowDy="1.0"
            android:shadowRadius="1.0"
            android:text="00:00"
            android:textColor="#3c6dae"
            android:textSize="16dp" />
    </TableRow>

    <TableRow>

        <TextView
            android:id="@+id/feedback_list_item_comment"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            android:shadowColor="#cccccc"
            android:shadowDx="1.0"
            android:shadowDy="1.0"
            android:shadowRadius="0.5"
            android:text="No comment"
            android:textColor="#222222"
            android:textSize="16dp" />
        >
    </TableRow>
</TableLayout>

</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-06-05T23:15:28+00:00Added an answer on June 5, 2026 at 11:15 pm

    Use a RelativeLayout for each row of your table. E.g. try the following code in place of your two TableRows:

    <RelativeLayout
        android:layout_height="wrap_content">
    
        <TextView
            android:id="@+id/feedback_list_item_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:gravity="left"
            android:shadowColor="#bdbebd"
            android:shadowDx="1.0"
            android:shadowDy="1.0"
            android:shadowRadius="0.5"
            android:text="Unknown"
            android:textColor="#000000"
            android:textSize="16dp"
            android:textStyle="bold"
            android:lines="1"/>
    
        <TextView
            android:id="@+id/feedback_list_item_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="5dp"
            android:layout_marginTop="5dp"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:gravity="right"
            android:shadowColor="#bdbebd"
            android:shadowDx="1.0"
            android:shadowDy="1.0"
            android:shadowRadius="1.0"
            android:text="00:00"
            android:textColor="#3c6dae"
            android:textSize="16dp" />
    
        <TextView
            android:id="@+id/feedback_list_item_comment"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="5dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@id/feedback_list_item_name"            
            android:shadowColor="#cccccc"
            android:shadowDx="1.0"
            android:shadowDy="1.0"
            android:shadowRadius="0.5"
            android:text="No comment"
            android:textColor="#222222"
            android:textSize="16dp"
            android:maxLines="2" />
    
    </RelativeLayout>
    

    Also, adding maxLines=”2″ to the comment TextView will limit it to two lines.

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

Sidebar

Related Questions

I'm trying to design a theme on WordPress (version 3.3.2) but I am having
im trying to populate my listview beneath my tab function but for some reason
I'm trying to design an easily extendable form system in javascript, but am having
i am trying to design some nice listbox, but every time i click on
I'm trying to design some images and button images for an Android app. But
I am trying to design my Class Diagram. But I get stuck on this
I am trying to design some kind of user to user relationship, such as
I'm trying to design a font selection tool where a user can select one
I'm trying to design a button with orange background and rounded borders but the
I'm currently trying to design an application and I'm having trouble trying to decide

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.