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

The Archive Base Latest Questions

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

I’m trying to make my tablelayout which is nested in a relativeview scrollable. Tried

  • 0

I’m trying to make my tablelayout which is nested in a relativeview scrollable.
Tried a couple of tutorials but nothing worked. Here is the xml and my java code:

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

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/white" android:padding="10px"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/textView1"
    android:paddingBottom="10dp" android:text="Mijn Rooster"
    android:textSize="20sp" android:layout_alignParentTop="true"
    android:layout_alignLeft="@+id/tablelayout"></TextView>
<ScrollView android:id="@+id/ScrollView01"
    android:layout_width="wrap_content" android:layout_height="wrap_content">
    <TableLayout android:id="@+id/tablelayout"
        android:layout_width=
"fill_parent" android:layout_height="wrap_content"
        android:stretchColumns="0" android:layout_below="@+id/textView1"
        android:layout_above="@+id/btnsearch">

    </TableLayout>
</ScrollView>

<Button android:id="@+id/btnsearch" android:layout_width="wrap_content"
    android:text="Zoek op Datum" android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"></Button>
</RelativeLayout>

And here is the JAVA code:

TableLayout tl = (TableLayout) findViewById(R.id.tablelayout);

    if (date_selected == null) {
        for (int i = 0; i < roostermap.size(); i++) {

            TableRow trdaydatetime = new TableRow(this);
            TableRow trinfo = new TableRow(this);

            trdaydatetime.setLayoutParams(new LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

            TableRow.LayoutParams rowSpanLayout = new TableRow.LayoutParams(
                    TableRow.LayoutParams.FILL_PARENT,
                    TableRow.LayoutParams.WRAP_CONTENT);
            rowSpanLayout.span = 3;

            TextView txtDay = new TextView(this);
            TextView txtTime = new TextView(this);
            TextView txtResult = new TextView(this);

            // Set Text
            txtDay.setText(roostermap.get(i).getDay(
                    roostermap.get(i).getRoster_date().getDay(),
                    roostermap.get(i).getRoster_date())
                    + " " + df.format(roostermap.get(i).getRoster_date()));
            txtTime.setText(dft.format(roostermap.get(i).getRoster_start())
                    + " - " + dft.format(roostermap.get(i).getRoster_end()));
            txtResult.setText(roostermap.get(i).getWorkplace_name());

            // Day&Date Layout
            txtDay.setLayoutParams(new LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
            txtDay.setPadding(5, 5, 0, 0);
            txtDay.setTextColor(Color.BLACK);

            // Text Time layout
            txtTime.setLayoutParams(new LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
            txtTime.setTextColor(Color.BLACK);
            txtTime.setPadding(0, 5, 10, 0);
            txtTime.setGravity(Gravity.RIGHT);

            // Text Result layout
            txtResult.setLayoutParams(new LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
            txtResult.setPadding(5, 0, 0, 5);

            trdaydatetime.addView(txtDay);
            trdaydatetime.setBackgroundResource(R.drawable.trup);
            trdaydatetime.addView(txtTime);
            trinfo.addView(txtResult, rowSpanLayout);
            trinfo.setBackgroundResource(R.drawable.trdown);

            tl.addView(trdaydatetime, new TableLayout.LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
            tl.addView(trinfo, new TableLayout.LayoutParams(
                    LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
        }
  • 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-25T18:44:58+00:00Added an answer on May 25, 2026 at 6:44 pm

    In order for the ‘scrolling’ to work you need the content of the ScrollView to be larger than the ScrollView itself. Since you have set the android:layout_height value to wrap_content, the height of the ScrollView matches the height of its content – which means no scrolling.

    Fix the android:layout_height value of the ScrollView by either setting it to fill_parent (possibly with android:layout_weight) or a pixel value.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.