Android 在ImageView上滚动视图

Android 在ImageView上滚动视图,android,user-interface,scrollview,Android,User Interface,Scrollview,我需要将ScrollView中的内容滚动到ScrollView上方的静态图像视图上。当ImageView显示时,ScrollView需要正常滚动。其效果与CollasingToolbarLayout相同,但我需要在不使用actionbar和不使用效果的情况下执行此操作 就像这里- 我的布局文件: <ImageView android:id="@+id/full_image" android:layout_width="match_parent" android:la

我需要将ScrollView中的内容滚动到ScrollView上方的静态图像视图上。当ImageView显示时,ScrollView需要正常滚动。其效果与CollasingToolbarLayout相同,但我需要在不使用actionbar和不使用效果的情况下执行此操作

就像这里-

我的布局文件:

<ImageView
    android:id="@+id/full_image"
    android:layout_width="match_parent"
    android:layout_height="@dimen/full_image_height"
    android:scaleType="centerCrop"
    android:src="@mipmap/logo" />

<ScrollView
    android:id="@+id/scrollView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="@dimen/full_image_height">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:elevation="8dp"
        android:padding="@dimen/text_margin">

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_marginBottom="@dimen/small_margin"
            android:text="Large Text"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <TextView
            android:id="@+id/date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/title"
            android:text="Small Text"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
            android:id="@+id/time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/title"
            android:layout_marginLeft="@dimen/small_margin"
            android:layout_toEndOf="@+id/date"
            android:layout_toRightOf="@+id/date"
            android:text="Small Text"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="@color/colorAccent" />

        <TextView
            android:id="@+id/text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/date"
            android:layout_marginTop="@dimen/small_margin"
            android:text="Medium Text"
            android:textAppearance="?android:attr/textAppearanceMedium" />

    </RelativeLayout>

</ScrollView>



如果我从您的描述和您提供的youtube链接中正确理解了它,我认为这个库将适合您。这是一个惊人的库,你可以定义你的两个布局一个可以是一个布局,将有全屏图像视图,另一个可以是布局与您的滚动视图。通过这种方式,您可以获得完全相同的效果。此外,您还可以控制scrollview布局,并将其设置为屏幕中间或底部。用户可以将其拖动到全屏,或者可以将其固定在中间。试试看,如果你有什么困难就告诉我们

非常感谢你!这就是我一直在寻找的:)