如何解决此问题>属性app:constraintBottom_toBottomOf找不到

Tha*_*dol 5 java android android-layout

Android新手在这里。

我正在构建AR应用程序,现在打算添加一个用户界面。我正在尝试向中添加约束布局app:layout_constraintBottom_toBottomOf="parent",但是我收到未找到此约束的错误

这些是我的代码和错误消息:

代码和错误 更多错误

我在activity_ux.xml文件中添加的所有以“ app”开头的代码行app:layout_constraintBottom_toTopOf似乎都不起作用,我仅在此处向您展示了一个示例,其中的一个示例只是为了简化调试,我认为。

我尝试在线搜索,解决方案之一是我应该在我的SDK工具中安装“用于Android的ConstraintLayout”和“用于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>
Run Code Online (Sandbox Code Playgroud)

我希望这能正常工作,但我不知道我可以从哪里开始寻找内置函数(例如此函数)是否不起作用。

Tha*_*dol 6

谢谢你们的建议。我已经设法通过在依赖下将这行'com.android.support.constraint:constraint-layout:1.1.3'添加 到我的build.gradle(module.app)中来处理错误

再次感谢您所做的一切