【发布时间】:2017-11-10 18:52:58
【问题描述】:
我刚开始在我的 android 应用程序中使用 Snackbar,我无法将 ScrollView 缩小到不覆盖 ScrollView 内部的任何内容。
这是我的活动的 xml 布局:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
android:id="@+id/container"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground"
tools:context="com.example.MainActivity">
<ScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="16dp"
android:orientation="vertical">
[LOT OF ELEMENTS IN HERE]
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
我在 StackOverflow 上尝试了很多解决方案,但都没有任何效果。
【问题讨论】:
-
让你的scrollView变小是什么意思?
-
好吧,通常它的高度设置为match_parent,但是当snackbar出现时我希望它比snackbar的高度小
标签: android android-design-library android-snackbar