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

标签 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>

我在 spinner 中使用这个 xml 但不工作 android:fadeScrollbars="false"

我看到下面的链接,但还不能用:

How to always show scrollbar

最佳答案

你可以试试:

ScrollView.setScrollbarFadingEnabled(false);

关于android - Scrollview 并不总是显示滚动条 - android?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42525719/

相关文章:

android - 突出显示通过 EditText 搜索的所有单词

android - ViewPager : swipe not working 内的 ScrollView

android - 水平 ScrollView 的scrollTo()不起作用

android - 在 ScrollView 中隐藏滚动条

android - 滚动条未在 RecyclerView 中显示

android - Listview不滚动时隐藏滚动条

android - 自定义 View 中的涟漪效果

java - Android 4.4.2 SSL 握手中止

java - 使用 fire base 在 Android 应用程序中管理两种类型(学生和教师)的用户 session

Android 如何在 Spinner 中更改滚动条颜色