简体   繁体   中英

Static view in scrolling Viewpager in CoordinatorLayout

I'm currently working on app with a view hierarchy of CoordinatorLayout -> Viewpager -> Framelayout (contained in a fragment). The CoordinatorLayout ensures that the actionbar scrolls away when scrolling in the fragment.

The problem I'm facing is, that I would like to have a view in the bottom of the fragment that does not scroll, but instead always stays at the bottom of the fragment. The view should only exist in one of the fragments, meaning placing it outside the Viewpager does not work.

Is it possible to create a static view in the fragment (Framelayout)?

im not 100% sure if this is what your looking for if it isnt explain (with code) what your looking for. good luck with the project

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="1"
android:id="@+id/coordinatorLayout"
android:fitsSystemWindows="true">

//Part that will be static

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:layout_below="@+id/imageView2">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

     //part in the scrollfiew

    </LinearLayout>
</ScrollView>
</RelativeLayout>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM