【发布时间】:2018-10-20 02:12:41
【问题描述】:
使用drawable 文件更改ScrollView 中滚动的颜色后,更改在预览和设计中可见,但在我的手机上不可见。
ScrollViewsn-p
<ScrollView
android:layout_width="368dp"
android:layout_height="150dp"
android:layout_marginTop="8dp"
android:scrollbarThumbVertical="@drawable/scollbar"
android:scrollbarTrackVertical="@color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
android:scrollbarSize="4dp"
android:scrollbarAlwaysDrawVerticalTrack="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2"
app:layout_constraintVertical_bias="0.313">
<LinearLayout>
<TextView></TextView>
</LinearLayout>
</ScollView>
android:scrollbarThumbVertical 中的scollbar 不是错字。
谢谢。
【问题讨论】:
-
请设置 android:layout_height="wrap_content"
-
您可以为滚动视图中的布局提供背景颜色,而不是为滚动视图提供颜色。并尝试
-
@jayshah 如果我制作`android:layout_height = "wrap_content"` 那么,1. 我不需要滚动
ScrollView,因为我在TextView中的内容不够长。 2. 它不符合我的设计。我需要使用ScollView在下方添加更多内容。我也尝试过更改,但没有成功。 -
@UmangBurman 我正在尝试更改
ScrollView中 ScrollBar 的颜色
标签: android android-studio android-scrollview