为了账号安全,请及时绑定邮箱和手机立即绑定

如何修复此>属性应用程序:constraintBottom_toBottomOf未找到

如何修复此>属性应用程序:constraintBottom_toBottomOf未找到

慕容森 2022-09-07 21:53:20
安卓新手在这里。我正在构建和AR应用程序,现在我计划添加一个用户界面。我正在尝试添加约束布局,但是我得到错误,即找不到此约束app:layout_constraintBottom_toBottomOf="parent"这些是我的代码和错误消息:我在activity_ux.xml文件中添加的所有代码行都以“app”开头,例如 似乎不起作用,我只是在这里向您展示了一个示例,其中一个只是为了使其更易于调试。app:layout_constraintBottom_toTopOf我尝试在线搜索,其中一个解决方案是我应该在我的SDK工具中安装“ConstraintLayout for Android”和“Solver for ConstraintLayout”,但我已经安装了这个。    <FrameLayout           xmlns:android="http://schemas.android.com/apk/res/android"          xmlns:tools="http://schemas.android.com/tools"          android:layout_width="match_parent"          android:layout_height="match_parent"          xmlns:app="http://schemas.android.com/apk/res-auto"          tools:context="com.google.ar.sceneform.Overlei.Overlei">    <fragment android:name="com.google.ar.sceneform.ux.ArFragment"          android:id="@+id/ux_fragment"          android:layout_width="match_parent"          android:layout_height="match_parent" />    <LinearLayout          android:id="@+id/gallery_layout"          android:layout_width="match_parent"          android:layout_height="wrap_content"          android:orientation="horizontal"          app:layout_constraintBottom_toBottomOf="parent"  >   </LinearLayout>   </FrameLayout>我期望这只是工作,我不知道如果内置函数(例如这个)不起作用,我可以从哪里开始寻找。
查看完整描述

3 回答

?
达令说

TA贡献1821条经验 获得超6个赞

谢谢你的建议伙计们。我已经设法通过添加此行来处理错误

implementation 'com.android.support.constraint:constraint-layout:1.1.3'

进入我的下build.gradle(module.app)dependencies

再次,谢谢你的一切


查看完整回答
反对 回复 2022-09-07
?
梵蒂冈之花

TA贡献1900条经验 获得超5个赞

应仅在 中使用。您可以尝试在线性布局中使用内部。app:layout_constraintBottom_toBottomOfConstraintLayoutFrameLayoutandroid:gravity = "bottom"



查看完整回答
反对 回复 2022-09-07
?
慕桂英4014372

TA贡献1871条经验 获得超13个赞

将框架布局包装在约束布局中或将框架布局更改为约束布局


查看完整回答
反对 回复 2022-09-07
  • 3 回答
  • 0 关注
  • 189 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号