安卓新手在这里。我正在构建和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
再次,谢谢你的一切
梵蒂冈之花
TA贡献1900条经验 获得超5个赞
应仅在 中使用。您可以尝试在线性布局中使用内部。app:layout_constraintBottom_toBottomOfConstraintLayoutFrameLayoutandroid:gravity = "bottom"
添加回答
举报
0/150
提交
取消
