LayoutをConstraintLaoutからRelativeLayoutに変えたいのですが、やり方がわかりません。画像左下にあるComponent TreeのConstraintLaoutをRelativeLayoutに変えようとしてもConstraintLaoutを削除できません。
画像のものは新規プロジェクトを立ち上げたばかりのものです。
バージョンは2.3です。
回答者に返信
activity_main.xml
<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.spinner.myapplication.MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </android.support.constraint.RelativeLayout>
エミュレーターで実行するとMy Applicationが停止しましたと表示される。
ログにはなにも出てない。
その他バグと状態
解決しました。
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.spinner.myapplication.MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> </RelativeLayout>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/04/02 12:21
2017/04/02 12:25
退会済みユーザー
2017/04/02 12:39
2017/04/02 12:49
退会済みユーザー
2017/04/02 12:55