admin管理员组文章数量:1384692
I want to have my Scrollview always visible as you can see in the photo
The only problem is that I can manage to make the scrollbar background (this grey color) but not the white part that when you scroll it also scrolls. How can I make the white part also working?
My xml looks like this
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android=";
xmlns:app=";
xmlns:tools=";
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context=".MainActivity">
<!--I had to add this extra ScrollView otherwise the whole screen is not getting scrolled -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_marginEnd="15dp"
android:scrollbarThumbVertical="@color/white"
android:scrollbarTrackVertical="@color/greyed_out"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical"
android:fadeScrollbars="false"
android:scrollbarSize="30dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="30dp">
<other views...>
I have this line here android:scrollbarThumbVertical="@color/white"
but still nothing happens.
I want to have my Scrollview always visible as you can see in the photo
The only problem is that I can manage to make the scrollbar background (this grey color) but not the white part that when you scroll it also scrolls. How can I make the white part also working?
My xml looks like this
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android/apk/res/android"
xmlns:app="http://schemas.android/apk/res-auto"
xmlns:tools="http://schemas.android/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context=".MainActivity">
<!--I had to add this extra ScrollView otherwise the whole screen is not getting scrolled -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_marginEnd="15dp"
android:scrollbarThumbVertical="@color/white"
android:scrollbarTrackVertical="@color/greyed_out"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical"
android:fadeScrollbars="false"
android:scrollbarSize="30dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="30dp">
<other views...>
I have this line here android:scrollbarThumbVertical="@color/white"
but still nothing happens.
1 Answer
Reset to default 0I fixed my issue by removing completely NestedScrollView
and had my ScrollView
as the top element.
本文标签: androidScrollView always visible from the startStack Overflow
版权声明:本文标题:android - ScrollView always visible from the start - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744513533a2610023.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论