android–ConstraintLayout中的FrameLayout wrap_content

android–ConstraintLayout中的FrameLayout wrap_content,第1张

概述我在CoordinatorLayout中的FrameLayout不希望成为wrap_content.当我使用ui工具选择wrap_content时,它不会将其设置为wrap_content,而是将定义的高度设置为48dp.我也尝试直接在xml文件中设置它,它工作…直到我重新打开文件.我想AS的编辑正在做一些工作并将其高度重置为48dp.这就是

我在CoordinatorLayout中的FrameLayout不希望成为wrap_content.当我使用ui工具选择wrap_content时,它不会将其设置为wrap_content,而是将定义的高度设置为48dp.

我也尝试直接在xml文件中设置它,它工作…直到我重新打开文件.我想AS的编辑正在做一些工作并将其高度重置为48dp.

这就是我的布局:

<layout    xmlns:tools="http://schemas.androID.com/tools"    xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto">    <data>        <import type="androID.vIEw.VIEw" />        <variable            name="viewmodel"            type="com.mydomain.relationviewmodel" />    </data>    <relativeLayout        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content">        <Progressbar            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:indeterminate="true"            androID:layout_centerInParent="true"            androID:visibility="@{viewmodel.isLoading() ? VIEw.VISIBLE : VIEw.GONE}"/>        <androID.support.constraint.ConstraintLayout            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content"            androID:visibility="@{viewmodel.isLoading() ? VIEw.INVISIBLE : VIEw.VISIBLE}">            <TextVIEw                androID:layout_wIDth="0dp"                androID:layout_height="wrap_content"                androID:ID="@+ID/hint"                tools:text="Relation"                androID:layout_marginStart="16dp"                app:layout_constraintleft_toleftOf="parent"                androID:layout_marginleft="16dp"                androID:text="@string/relationship_spinner_hint"                androID:layout_margintop="16dp"                app:layout_constrainttop_totopOf="parent"                app:layout_constraintBottom_toBottomOf="@+ID/spinner" />            <Spinner                androID:layout_wIDth="0dp"                androID:layout_height="48dp"                androID:ID="@+ID/spinner"                androID:dropDownWIDth="match_parent"                androID:layout_marginEnd="16dp"                app:layout_constraintRight_toRightOf="parent"                androID:layout_marginRight="16dp"                app:layout_constraintleft_toRightOf="@+ID/hint"                androID:layout_marginStart="16dp"                androID:layout_marginleft="16dp"                androID:layout_margintop="16dp"                app:layout_constrainttop_totopOf="parent"                app:setonItemSelectedListener="@{viewmodel.relationshipsListener}"/>            <FrameLayout                androID:layout_wIDth="0dp"                androID:layout_height="48dp"                app:layout_constraintRight_toRightOf="parent"                app:layout_constraintleft_toleftOf="parent"                androID:ID="@+ID/search_fragment_container"                androID:layout_marginEnd="16dp"                androID:layout_marginRight="16dp"                app:layout_constraintHorizontal_bias="0.0"                app:layout_constrainttop_toBottomOf="@+ID/search_patIEnt_Title">            </FrameLayout>            <button                androID:text="@string/cancel"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:ID="@+ID/cancel"                app:layout_constraintleft_toleftOf="parent"                                androID:layout_margintop="8dp"                app:layout_constrainttop_toBottomOf="@+ID/search_fragment_container" />            <TextVIEw                androID:text="@string/search_patIEnt"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:ID="@+ID/search_patIEnt_Title"                androID:layout_margintop="8dp"                app:layout_constrainttop_toBottomOf="@+ID/spinner"                androID:layout_marginStart="16dp"                app:layout_constraintleft_toleftOf="parent"                androID:layout_marginleft="16dp"                tools:text="Recherche du patIEnt"                 />        </androID.support.constraint.ConstraintLayout>    </relativeLayout></layout>

这是我的蓝图的截图(所选布局是FrameLayout):

感谢您的任何进一步帮助!

编辑
与CardVIEw有同样的问题(看似合法,因为它是一个FrameLayout孩子).

解决方法:

正如这篇Google bug ticket所说:

Fixed in master.

Released with AndroID Studio 2.3 beta 1

总结

以上是内存溢出为你收集整理的android – ConstraintLayout中的FrameLayout wrap_content全部内容,希望文章能够帮你解决android – ConstraintLayout中的FrameLayout wrap_content所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1117340.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存