Scrollview总是不显示滚动条 - android?

时间:2017-03-01 07:31:56

标签: android android-scrollview android-scrollbar

我吼叫xml

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#434A54"
        android:gravity="end"
        android:orientation="vertical">

        <TextView
            android:id="@+id/txtInternalTitleProvince"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="10dp"
            android:textSize="15sp"
            android:textStyle="bold"
            android:typeface="serif" />

        <View
            android:id="@+id/VInternalItemProvince"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:layout_marginStart="50dp"
            android:background="@color/Withe"
            android:visibility="gone" />
    </LinearLayout>
</ScrollView>

我在xml使用此spinner,但无法使用android:fadeScrollbars="false"

我看到了bellow链接但还没有工作:

How to always show scrollbar

1 个答案:

答案 0 :(得分:1)

您可以尝试:

ScrollView.setScrollbarFadingEnabled(false);