如何解决此问题>找不到属性app:constraintBottom_toBottomOf [英] How to fix this > attribute app:constraintBottom_toBottomOf not found
问题描述
Android新手在这里.
Android newbie here.
我正在构建AR应用程序,现在正计划添加一个用户界面.我正在尝试将约束布局添加到app:layout_constraintBottom_toBottomOf="parent"
,但是我收到未找到此约束的错误
I am building and AR app and now I'm planning to add a User Interface. I am trying to add a constraint layout to app:layout_constraintBottom_toBottomOf="parent"
, however Im getting the error that this constraint was not found
这些是我的代码和错误消息:
These are my codes and error messages:
我在activity_ux.xml文件中添加的所有以"app"开头的代码行
例如app:layout_constraintBottom_toTopOf
似乎不起作用,我只是在这里向您展示了一个示例,其中的一个示例只是为了简化我认为的调试.
All the lines of code I add in my activity_ux.xml file that begin with "app"
e.g. app:layout_constraintBottom_toTopOf
do not seem to work, I just showed you an example here with one of them just to make it easier to debug I think.
我尝试在线搜索,其中一种解决方案是我应该在我的SDK工具中安装用于Android的ConstraintLayout"和用于ConstraintLayout的求解器",但是我已经安装了此工具.
I tried searching online, one of the solutions was that I should install "ConstraintLayout for Android" and "Solver for ConstraintLayout" in my SDK Tools, but I already had this installed.
<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>
我希望它能正常工作,但我不知道在哪里可以找到内置函数(例如此函数)是否不起作用.
I expected this to just work, I don't know where I can start looking if an in-built function(such as this) does not work.
推荐答案
感谢大家的建议.通过添加此行,我设法解决了该错误
Thanks for the suggestions guys. I have managed to deal with the error by adding this line
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
进入我的build.gradle(module.app)
在dependencies
再次感谢您所做的一切
这篇关于如何解决此问题>找不到属性app:constraintBottom_toBottomOf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!