我试图将我的ConstraintLayout添加到nestedScrollVIEw.
在观看我的ContraintLayout时,一切看起来都很好.
但是然后将布局包含到我的nestedScrollVIEw中会折叠ContraintLayout.(即使我在include和我的CL中使用匹配父宽度/ heigt)
这实际上是之前版本的ContraintLayout(~pre beta).Google Bug Reports中的一个错误
我正在使用Verion beta4.Link to Youtube AndroidDev Channel这种方法
constraint_layout.xml:
<androID.support.design.Widget.CoordinatorLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:app="http://schemas.androID.com/apk/res-auto" xmlns:tools="http://schemas.androID.com/tools" androID:ID="@+ID/coordinator_layout" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:fitsSystemwindows="true" tools:context="de.project.andy.aliver.JobCreatorActivity"> <include layout="@layout/content_job_creator" /> <androID.support.design.Widget.AppbarLayout androID:ID="@+ID/app_bar" androID:layout_wIDth="match_parent" androID:layout_height="145dp" androID:fitsSystemwindows="true" androID:theme="@style/Apptheme.AppbarOverlay"> <androID.support.design.Widget.CollapsingToolbarLayout androID:ID="@+ID/toolbar_layout" androID:layout_wIDth="match_parent" androID:layout_height="143dp" androID:fitsSystemwindows="true" app:contentScrim="?attr/colorPrimary" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <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/Apptheme.PopupOverlay" /> </androID.support.design.Widget.CollapsingToolbarLayout> </androID.support.design.Widget.AppbarLayout> <androID.support.design.Widget.@R_502_5987@ingActionbutton androID:ID="@+ID/jc_fab" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:src="@androID:drawable/arrow_up_@R_502_5987@" androID:layout_gravity="end|bottom" app:fabSize="normal" androID:layout_margin="15dp" /></androID.support.design.Widget.CoordinatorLayout>
nested_scrollvIEw_layout.xml:
<androID.support.v4.Widget.nestedScrollVIEw xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:app="http://schemas.androID.com/apk/res-auto" xmlns:tools="http://schemas.androID.com/tools" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_vIEw_behavior" tools:context="de.project.andy.aliver.JobCreatorActivity" tools:showIn="@layout/activity_job_creator"> <include layout="@layout/constraint_layout" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" /></androID.support.v4.Widget.nestedScrollVIEw>
有解决方法吗?
解决方法:
天啊……没有答案就要研究一个小时.
创建SO帖子并在5分钟后找到答案.
上面描述的这个问题与ScrollVIEw中的相同.解决方案是添加
androID:fillVIEwport="true"
到可滚动的父级.
所以nested_scrollvIEw_layout.xml将是:
<androID.support.v4.Widget.nestedScrollVIEw xmlns:androID="http://schemas.androID.com/apk/res/androID"xmlns:app="http://schemas.androID.com/apk/res-auto"xmlns:tools="http://schemas.androID.com/tools"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"androID:fillVIEwport="true"app:layout_behavior="@string/appbar_scrolling_vIEw_behavior"tools:context="de.project.andy.aliver.JobCreatorActivity"tools:showIn="@layout/activity_job_creator"><include layout="@layout/constraint_layout" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" /></androID.support.v4.Widget.nestedScrollVIEw>
总结 以上是内存溢出为你收集整理的java – NestedScrollView中的Android约束布局Renderproblems全部内容,希望文章能够帮你解决java – NestedScrollView中的Android约束布局Renderproblems所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)