0

I have a custom list adapter inside of a TableLayout. This TableLayout is nested inside a of a LinearLayout.

The list adapter expands if new childviews are added to the list. I want the size of the TableRow to increase dynamically when the size of the list adapter increases. And the buttons pushed down when the list grows.

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

        <LinearLayout">
            <!-- Draw header + sub title -->
            <LinearLayout android:orientation="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent" >
                <TextView ></TextView>
                <TextView ></TextView>
            </LinearLayout>

            <LinearLayout android:orientation="horizontal">
                <ImageView />
                <LinearLayout android:orientation="vertical" android:layout_height="fill_parent" android:layout_width="fill_parent" 
                    android:layout_weight="1">
                    <TableLayout android:layout_height="fill_parent" android:layout_width="fill_parent"  android:layout_weight="1">
                        <TableRow android:id="@+id/tr1">
                            <CustomList android:id="@+id/mainview"
                                ndroid:layout_height="wrap_content" android:layout_width="wrap_content" />
                        </TableRow>
                        <TableRow android:layout_height="wrap_content"
                            android:layout_width="match_parent">
                            <Button android:layout_width="wrap_content" android:id="@+id/button1"
                                android:text="@string/buttonPrevious" android:layout_height="wrap_content">
                            </Button>
                            <Button android:layout_width="wrap_content" android:id="@+id/button2"
                                android:text="@string/buttonNext" android:layout_height="wrap_content"></Button>
                        </TableRow>
                    </TableLayout>
                </LinearLayout>
                <ImageView  />

        </LinearLayout>
    </ScrollView>

Do I have to do change something like change the way layouts are inflated in my custom list adapter or anything else?

1

1 Answer 1

1

Please read the following question and answers. I believe this may be the same thing you are trying to achieve

Android ListView that does not scroll?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.