安卓新手在這里。我正在構建和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_toBottomOf
ConstraintLayout
FrameLayout
android:gravity = "bottom"
添加回答
舉報
0/150
提交
取消