Android UI cordinator布局或嵌套滚动视图问题

时间:2017-07-09 13:47:32

标签: android-coordinatorlayout android-nestedscrollview

我在CoordinatorLayout中使用嵌套的scrollview我有不同的水平线,它们堆叠在嵌套的scrollview中。我无法修复不需要的空间(我已经为空间添加了蓝色)。 enter image description here 任何人有任何修复或我做错了什么?

    <android.support.design.widget.CoordinatorLayout 
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:fresco="http://schemas.android.com/tools"
    android:id="@+id/cordinator_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#00f"
    app:layout_scrollFlags="scroll|enterAlways">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBar"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:fitsSystemWindows="true"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginEnd="64dp"
            app:expandedTitleMarginStart="48dp"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <com.facebook.drawee.view.SimpleDraweeView
                android:id="@+id/movie_poster"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_alignParentTop="true"
                android:fitsSystemWindows="true"
                android:scaleType="centerCrop"
                app:layout_collapseMode="pin"
                fresco:placeholderImage="@drawable/placeholder" />

            <android.support.design.widget.TabLayout
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:layout_gravity="bottom"
                app:tabContentStart="72dp"
                app:tabMode="scrollable" />


            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/appBar"
        android:fitsSystemWindows="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">


        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#0f0"
            android:orientation="vertical">


            <android.support.v7.widget.CardView
                android:id="@+id/info_card_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

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

                    <TextView
                        android:id="@+id/plot_synopsis"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@color/cardview_dark_background"
                        android:maxLines="4"
                        android:paddingLeft="10dp"
                        android:paddingRight="10dp"
                        android:textColor="#fff"
                        android:textSize="21sp" />

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="@color/cardview_dark_background"
                        android:orientation="horizontal">

                        <LinearLayout
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_weight="3"
                            android:baselineAligned="false"
                            android:orientation="vertical"
                            android:padding="10dp"
                            android:weightSum="4">

                            <TextView
                                android:id="@+id/release_date"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textColor="#fff"
                                android:textSize="20sp" />


                            <TextView
                                android:id="@+id/vote"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textColor="#fff"
                                android:textSize="20sp" />


                        </LinearLayout>

                        <Button
                            android:id="@+id/b11"
                            style="?android:attr/buttonStyleSmall"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="@drawable/fav" />
                    </LinearLayout>
                </LinearLayout>


            </android.support.v7.widget.CardView>


            <LinearLayout
                android:id="@+id/nextAirLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="10dp"
                android:background="@color/cardview_dark_background"
                android:orientation="vertical">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_margin="10dp"
                    android:text="@string/next_episode"
                    android:textColor="#fff"
                    android:textStyle="bold" />

                <include
                    layout="@layout/episode_layout"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

            </LinearLayout>

            <include
                android:id="@+id/tvSeasonsCard"
                layout="@layout/image_card"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="10dp" />

            <include
                android:id="@+id/tvCastCard"
                layout="@layout/image_card"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="10dp" />

            <include
                android:id="@+id/videosCard"
                layout="@layout/image_card"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="10dp" />


            <include
                android:id="@+id/similarTvShowsCard"
                layout="@layout/image_card"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="10dp" />

            <include
                android:id="@+id/recommendedTvShowsCard"
                layout="@layout/image_card"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="10dp" />
        </LinearLayout>


    </android.support.v4.widget.NestedScrollView>

</android.support.design.widget.CoordinatorLayout>

0 个答案:

没有答案
相关问题