5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Android Studio] buttonの配置が指定した場所にならない

Posted at

問題

Android Studio開始初日
Buttonの場所がずっと左上になる
before.png

解決方法

非常に簡単でした.

<Button
...
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
/>

この4つを指定したら,Designdで編集したレイアウトが反映されるので良かった.
after.png

ただこの設定をすべての要素に記述しなければならないので,手間・・・
まとめて記述する方法はないんですかね・・・

参考文献

teratail:Android Studio2.3でボタンの配置がズレる。

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?