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

The Archive Base Latest Questions

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

I have a ListView which I’ve created a custom view for each row. My

  • 0

I have a ListView which I’ve created a custom view for each row. My view consist of two text view that I want to display side by side. The first textview (idno) has a background image set which I center my text over. The second textview (materials) has a variable number of lines for each row.

The issue that I’m having is that the lines go beyond the right side before wrapping. It seems that it is not accounting for the first textview width.

Here is my layout file:

<TableLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent">
<TableRow>
    <TextView 
        android:id="@+id/idno"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:gravity="center"
        android:textColor="#000000"
        android:textStyle="bold"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>    
    <TextView 
        android:id="@+id/materials"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:textColor="#0000ff"
        android:textStyle="bold"
        android:textSize="12sp"
        android:maxLines="5"
        android:layout_gravity="center_vertical"
        android:layout_marginLeft="10sp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
</TableRow> 

Any suggestions or solutions would be very much appreciated. Thanks in advanced!

  • 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-03T13:09:18+00:00Added an answer on June 3, 2026 at 1:09 pm

    I would suggest you to use LinearLayout with orientation="horizontal" to display two TextViews like :

    <LinearLayout
        android:orientation="horizontal">
        <TextView/>
        <TextView/>
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a listview which I am populating with a custom SimpleCursorAdapter, each row
I have a ListView which contains custom rows. This custom row has following UI
I have a listview which contains maybe 15 rows. Each row (list item) contains
I have a listview which loads its data from sqlite database. Each row in
I have a custom listview which display an image, textview and radio button. I
I have ListView which as one TextView in each Row. and im discovering some
I have a ListView which contains a text field that is populated using a
I have a ListView which uses a custom adapter to display rows of data.
I have ListView with custom Adapter which supplies View to ListView in this way:
I have a ListView which is using a GridView to display a DataTable and

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.