0

I have a vertical scroll bar inside a horizontal one. The vertical scroll bar is only visible when I scroll horizontally all the way to the right. But I want it to be always visible.

How can I do this? Any help? thanks in advance

My xml looks like this

<HorizontalScrollView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@id/gridTitle"
    android:layout_marginLeft="30dp"
    android:layout_marginRight="18dp"
    android:layout_marginBottom="5dp"
    android:fadeScrollbars="false" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginBottom="13dp">

        <!-- This Table Layout is header followed by the table itself-->
        <TableLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:stretchColumns="*" >

            <TableRow 
                android:id="@+id/tableHeader"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">
            </TableRow>

        </TableLayout>

       <ScrollView 
                android:id="@+id/verticalScroll"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:fadeScrollbars="false">

                <TableLayout
                    android:id="@+id/layout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="12dp"
                    android:stretchColumns="*" >
                </TableLayout>

        </ScrollView> 

    </LinearLayout>

</HorizontalScrollView>

EDITED:

The problem is, that the vertical scroll bar is outside of the screen (if I have a lot of table columns), so I can only see it when I scroll through horizontally.But I want it to be always visible.

4

2 回答 2

2

只需删除

android:fadeScrollbars="false"

行或成功true在这里阅读。

android:fadeScrollbars => 定义滚动条在不使用时是否淡出。

编辑

尝试在您的视图中遵循两行。我删除行android:fadeScrollbars="false"并添加以下 2 行。

android:scrollbarFadeDuration="0"
android:scrollbarDefaultDelayBeforeFade="0"
于 2013-06-18T07:17:05.440 回答
0

使用 ScrollView.setScrollbarFadingEnabled(false);

于 2013-06-18T07:34:13.413 回答