如何为我的Imageview添加以下类型的动画

时间:2017-04-28 11:27:01

标签: android imageview horizontal-scrolling background-foreground

请查看我的视频,其中显示了我的Imageview的动画/设计。 我该如何添加这样的内容?first you see the normal imageview

after scrolling, the text goes into the foreground and the Image into the Background. How is this possible

1 个答案:

答案 0 :(得分:0)

如果你想实现这一点,你可以像这样做

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
    android:layout_width="match_parent"
    android:layout_height="100dp" />

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <View
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:background="@android:color/transparent" />


        <!--your layout -->

    </LinearLayout>

</ScrollView>
</RelativeLayout>