I load a smiliar layout when my fragment starts:
<ScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/firstView" />
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/secondView" />
</LinearLayout>
</ScrollView>
When the fragment starts I want my firstView
to be (so to speak) hidden and when a user scrolls down it should move with secondView
so it becomes visible.
Basically I would like my ScrollView to be started with negative position. The problem is I don't know the height of firstView
.
Is it possible to define this behavior with xml attributes?
Regards,
roncsak