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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:58:44+00:00 2026-05-31T02:58:44+00:00

I’ve been assigned to create an activity that displays table of changes made to

  • 0

I’ve been assigned to create an activity that displays table of changes made to the app by version. The table has four columns, Id, Type, Description, and Version.

To do this, I placed a TableLayout in a scrollView. Then, I have a template for the TableRows, that are inflated dynamically at Runtime. The column widths should stay static; they can overflow in height but not width.

To achieve this, I tried using the weight & weight: sum property of the column and row container respectively. I have set the layout_width to 0 on both.

The problem is that the columns are expanding outside the screen boundaries. I would post the images but I don’t have the authority.

(Landscape looks close but you can see that the outer boundry is still being cut off).

I noticed that in if the weights of the children add to about 45% of the total then the weighting comes close to looking right.

Finally, the views separating the columns have been given a weight of zero, and 1dip width. (I’m not sure if that could be causing a problem).

To me it looks like that weighting is using the width as if it was in landscape mode. Do I have to make two layouts, one for portrait, and one for landscape?

I’ve added the XML layout for the table row:

<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/table_row_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <View
            android:id="@+id/top_border"
            android:layout_width="match_parent"
            android:layout_height="1dip"
            android:background="#FFFFFF" />

        <LinearLayout
            android:id="@+id/horizontal_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:weightSum="4" >

            <View
                android:id="@+id/view1"
                android:layout_width="1dip"
                android:layout_height="match_parent"
                android:background="#FFFFFF" android:layout_weight="0.01"/>

            <TextView
                android:id="@+id/txt_id"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:text="Id" android:textSize="10sp" android:layout_weight="0.5"/>

            <View
                android:id="@+id/view2"
                android:layout_width="1dip"
                android:layout_height="match_parent"
                android:background="#FFFFFF" android:layout_weight="0.01"/>

            <TextView
                android:id="@+id/txt_type"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:text="Type" android:textSize="10sp" android:layout_weight="1"/>

            <View
                android:id="@+id/view3"
                android:layout_width="1dip"
                android:layout_height="match_parent"
                android:background="#FFFFFF" android:layout_weight="0.01"/>

            <TextView
                android:id="@+id/txt_desc"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:text="Description" android:textSize="10sp" android:layout_weight="2"/>

            <View
                android:id="@+id/view4"
                android:layout_width="1dip"
                android:layout_height="match_parent"
                android:background="#FFFFFF" android:layout_weight="0.01"/>

            <TextView
                android:id="@+id/txt_version"
                android:layout_width="0dip"
                android:layout_height="wrap_content"
                android:text="Version" android:textSize="10sp" android:layout_weight="0.5"/>

            <View
                android:id="@+id/view6"
                android:layout_width="1dip"
                android:layout_height="match_parent"
                android:background="#FFFFFF" android:layout_weight="0.01"/>
        </LinearLayout>

        <View
            android:id="@+id/view7"
            android:layout_width="match_parent"
            android:layout_height="1dip" android:background="#FFFFFF"/>

    </LinearLayout>

</TableRow>

The upper and lower view are top and bottom borders.

And here is the layout for the table that its getting added too:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" android:scrollbarAlwaysDrawVerticalTrack="true">

    <ScrollView
        android:id="@+id/view_scroll"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" android:fillViewport="true">

        <TableLayout
            android:id="@+id/table_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:shrinkColumns="0"
            android:stretchColumns="0" >
        </TableLayout>

    </ScrollView>

</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-05-31T02:58:45+00:00Added an answer on May 31, 2026 at 2:58 am

    Thanks MH.

    Sorry for not getting back to you sooner. (I’m new to Android and Stack Overflow…and I didn’t realize that you answered my questsion.) I’ve added the row layout.

    <?xml version="1.0" encoding="utf-8"?>
    <TableRow xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    
        <LinearLayout
            android:id="@+id/table_row_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >
    
            <View
                android:id="@+id/top_border"
                android:layout_width="match_parent"
                android:layout_height="1dip"
                android:background="#FFFFFF" />
    
            <LinearLayout
                android:id="@+id/horizontal_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:weightSum="4" >
    
                <View
                    android:id="@+id/view1"
                    android:layout_width="1dip"
                    android:layout_height="match_parent"
                    android:background="#FFFFFF" android:layout_weight="0.01"/>
    
                <TextView
                    android:id="@+id/txt_id"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:text="Id" android:textSize="10sp"       android:layout_weight="0.20"/>
    
                <View
                    android:id="@+id/view2"
                    android:layout_width="1dip"
                    android:layout_height="match_parent"
                    android:background="#FFFFFF" android:layout_weight="0.01"/>
    
                <TextView
                    android:id="@+id/txt_type"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:text="Type" android:textSize="10sp" android:layout_weight="0.5"/>
    
                <View
                    android:id="@+id/view3"
                    android:layout_width="1dip"
                    android:layout_height="match_parent"
                    android:background="#FFFFFF" android:layout_weight="0.01"/>
    
                <TextView
                    android:id="@+id/txt_desc"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:text="Description" android:textSize="10sp" android:layout_weight="1"/>
    
                <View
                    android:id="@+id/view4"
                    android:layout_width="1dip"
                    android:layout_height="match_parent"
                    android:background="#FFFFFF" android:layout_weight="0.01"/>
    
                <TextView
                    android:id="@+id/txt_version"
                    android:layout_width="0dip"
                    android:layout_height="wrap_content"
                    android:text="Version" android:textSize="10sp" android:layout_weight="0.25"/>
    
                <View
                    android:id="@+id/view6"
                    android:layout_width="1dip"
                    android:layout_height="match_parent"
                    android:background="#FFFFFF" android:layout_weight="0.01"/>
            </LinearLayout>
    
            <View
                android:id="@+id/view7"
                android:layout_width="match_parent"
                android:layout_height="1dip" android:background="#FFFFFF"/>
    
        </LinearLayout>
    
    </TableRow>
    

    David

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I'm trying to create an if statement in PHP that prevents a single post
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a

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.