Android初心者です。
私はARアプリを構築しており、現在ユーザーインターフェイスを追加する予定です。制約レイアウトを追加しようとしていますapp:layout_constraintBottom_toBottomOf="parent"
が、この制約が見つからないというエラーが発生します。
これらは私のコードとエラー メッセージです:
たとえば、「app」で始まる activity_ux.xml ファイルに追加したすべてのコード行app:layout_constraintBottom_toTopOf
が機能していないようです。ここでは、デバッグを容易にするために、そのうちの 1 つの例を示しただけだと思います。
オンラインで検索してみたところ、解決策の 1 つとして、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>
私はこれが動作すると期待していましたが、組み込み関数(このようなもの)が動作しない場合はどこから調べ始めればよいかわかりません。
ベストアンサー1
皆さんの提案に感謝します。この行を追加することでエラーに対処できました。
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
私build.gradle(module.app)
の下にdependencies
改めて、すべてに感謝します