Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/183.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 嵌套滚动视图未显示内部坐标布局_Java_Android_Android Layout_Layout_Android Coordinatorlayout - Fatal编程技术网

Java 嵌套滚动视图未显示内部坐标布局

Java 嵌套滚动视图未显示内部坐标布局,java,android,android-layout,layout,android-coordinatorlayout,Java,Android,Android Layout,Layout,Android Coordinatorlayout,我有CoordinatorLayout和NestedScrollView以及collavingToolbarLayout。我将所有内容放在折叠工具栏布局中,首先要在屏幕上显示,然后添加NestedScrollView以显示更多内容,但NestedScrollView在屏幕上不可见 这是我的XML布局 <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout

我有
CoordinatorLayout
NestedScrollView
以及
collavingToolbarLayout
。我将所有内容放在折叠工具栏布局中,首先要在屏幕上显示,然后添加
NestedScrollView
以显示更多内容,但
NestedScrollView
在屏幕上不可见

这是我的XML布局

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:fitsSystemWindows="true"
    android:clipToPadding="false"
    android:background="?android:attr/colorBackground"
    android:id="@+id/viewuserProfileMain"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <RelativeLayout
                android:id="@+id/relativeParent"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <ImageView
                    android:id="@+id/upCoverPhoto"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@color/redName"/>


                <!--PUT TOOLBAR HERE-->
                <RelativeLayout
                    android:id="@+id/upDetails"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@drawable/diagonal_cut_layerlist"
                    android:elevation="12dp"
                    android:translationZ="12dp"
                    android:layout_marginLeft="15dp"
                    android:layout_marginRight="15dp"
                    android:layout_marginTop="115dp">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="115dp"
                        android:layout_marginRight="10dp"
                        android:gravity="end"
                        android:orientation="horizontal">
                        <Button
                            android:id="@+id/Button_FollowFriends"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            style="@style/AppButton"
                            android:text="Follow"
                            />

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

                        <de.hdodenhof.circleimageview.CircleImageView
                            android:id="@+id/profilePicture_Cut"
                            android:layout_width="80dp"
                            android:layout_height="80dp"
                            android:src="@drawable/baby"
                            app:civ_border_width="2dp"
                            app:civ_border_color="@color/primary"
                            android:layout_marginTop="85dp"
                            android:layout_marginLeft="15dp"/>
                        <TextView
                            android:id="@+id/upUserName"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="@color/secondary_text"
                            android:layout_marginTop="10dp"
                            android:textSize="28sp"
                            android:layout_marginLeft="10dp"
                            android:text="Susan Ledger"/>

                        <TextView
                            android:id="@+id/upUserCity"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:drawableLeft="@drawable/home"
                            android:drawablePadding="5dp"
                            android:layout_marginTop="5dp"
                            android:layout_marginLeft="10dp"
                            android:textSize="18sp"
                            android:textColor="@color/secondary_text"
                            android:text="Delhi,India"/>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="15dp"
                            android:gravity="center"
                            android:orientation="horizontal"
                            android:weightSum="3">
                            <Button
                                android:id="@+id/Button_AddFriend"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                style="@style/AppButton"
                                android:text="Add Friend"
                                android:layout_weight="1"/>

                            <Button
                                android:id="@+id/Button_RejectRequest"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                style="@style/AppButton"
                                android:text="Reject"
                                android:layout_weight="1"/>

                            <Button
                                android:id="@+id/Button_MessageFriend"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                style="@style/AppButton"
                                android:text="Message"
                                android:layout_weight="1"/>



                        </LinearLayout>

                    </LinearLayout>



                </RelativeLayout>
            </RelativeLayout>

        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>


    <android.support.v4.widget.NestedScrollView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/up_NestedScrollView"
        android:fillViewport="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">



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

            <!--To show tab on top of view pager-->
            <android.support.design.widget.TabLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:tabMode="scrollable"
                app:tabTextColor="@color/place_autocomplete_prediction_primary_text_highlight"
                app:tabSelectedTextColor="@color/primary_text"
                app:tabIndicatorColor="@color/primary_light"
                android:id="@+id/up_Viewpager_Tab">
            </android.support.design.widget.TabLayout>
            <android.support.v4.view.ViewPager
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_below="@id/userProfile_Viewpager_Tab"
                android:id="@+id/up_Viewpager_ViewPager">

            </android.support.v4.view.ViewPager>



        </RelativeLayout>

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

AppBarLayout

<android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

这些行指向您的
折叠工具栏布局

AppBarLayout

<android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
请尝试将这些行添加到您的
折叠工具栏布局

<android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:fitsSystemWindows="true">

因为
AppBar
无法
match\u parent

尝试给予

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:fitsSystemWindows="true">


因为
AppBar
不能
匹配父项

如果我在AppBarLayout中放入
wrap\u内容
,那么它会收缩整个内容,但我希望它适合整个屏幕。@androidXP那么你怎么能让两个布局填充一个屏幕?即使在wrap\u内容嵌套显示但不滚动之后all@androidXP尝试添加
android:fitsystemwindows=“false”app:contentScrim=“?attr/colorPrimary”app:layout\u scrollFlags=“scroll | enterally”
这些行到你的
折叠工具栏布局
工作正常,但我的圆形图像没有固定在工具栏上。你能帮我做点什么吗?如果我在AppBarLayout中放入
包装内容
,那么它会收缩整个内容,但我希望它适合整个屏幕。@androidXP那么你怎么能让两个布局填充一个屏幕?即使在包装内容嵌套显示,但不滚动all@androidXP尝试添加android:fitsSystemWindows=“false”app:contentScrim=“?attr/colorPrimary”app:layout\u scrollFlags=“scroll | enterally”
将这些行添加到您的
折叠工具栏布局中
其工作正常,但我的圆形图像未固定到工具栏中。您能帮我做些什么吗?当前我的
AppBar
是匹配父项且工作正常。当前我的
AppBar
是匹配父项且工作正常。