У меня есть макет, который я хочу применить прокрутку параллакса. Моя раскладка выглядит следующим образом:прокрутка параллакса в android
И соответствующий XML является:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/top_control_bar"
android:background="@drawable/container_dropshadow">
<RelativeLayout
android:id="@+id/logo_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="#ffffff">
<ImageView
android:id="@+id/organiser_logo"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/bottom_layout"
android:layout_below="@+id/top_control_bar">
<LinearLayout
android:orientation="vertical"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="fill_parent"
android:layout_below="@+id/top_control_bar"
android:layout_height="wrap_content"
android:background="@drawable/container_dropshadow"
android:id="@+id/explanation_wrapper">
<TextView
android:text="@string/no_event_header"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/explanation_header"
android:padding="8dip"
android:layout_width="wrap_content"
android:layout_height="fill_parent" />
<TextView
android:text="@string/no_event_text_1st_paragraph"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/explanation_1st_paragraph"
android:paddingTop="8dip"
android:paddingRight="20dip"
android:paddingBottom="10dip"
android:paddingLeft="10dip" />
</LinearLayout>
<ListView
android:id="@+id/album_active_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:choiceMode="singleChoice"
android:background="@drawable/container_dropshadow"
android:layout_below="@+id/explanation_wrapper" />
</RelativeLayout>
</RelativeLayout>
Мне нужно, чтобы получить средний слой будет прокручиваться над нижним слоем. И когда в верхней части нет места (средний слой полностью прокручивается над нижним слоем), мне нужен верхний слой для прокрутки над средним уровнем.
Как достичь такого поведения?
Есть ли что-то для Mono? Потому что это только родной Android. –
У меня есть порт здесь: https://github.com/Cheesebaron/ParallaxScrollView – Cheesebaron