java - 如何解决此问题 > 属性 app:constraintBottom_toBottomOf 未找到
问题描述
Android新手在这里。
我正在构建和 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>
我希望这能正常工作,我不知道如果内置函数(例如这个)不起作用,我可以从哪里开始寻找。
解决方案
谢谢你们的建议。我已经设法通过添加这一行来处理错误
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
进入我的build.gradle(module.app)
下dependencies
再次感谢您所做的一切
推荐阅读
- java - 如何制作透明缓冲图像
- r - ggplot2 R 在相对于绘图的特定点修复 x 轴标签
- python - 如何将图像上传到 Google Firestore 存储桶
- python - 我需要在数组中的值之前放置括号和编号
- javascript - 获取 Latt 和 lon 地理位置数据 - 我如何确定 N/S/E/W 并将它们添加到末尾
- python - 为什么在类中循环返回索引为 0 而不是 0,1,2,3...等?
- mysql - 将 UPDATE 查询合并为一个 SQL 查询
- php - 试图在 Laravel 中创建一个禁止按钮。不要得到任何错误只是找不到 - Laravel 8
- linux-kernel - LTTng/Perf:用于退出 (sched_process_exit) 和释放 (sched_process_free) 进程的事件之间的区别
- java - 如何有条件地初始化静态数组