質問編集履歴
4
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -47,4 +47,12 @@
|
|
47
47
|
<string name="title_janken">じゃんけんゲーム</string>
|
48
48
|
<string name="button_showsign">ポン</string>
|
49
49
|
</resources>
|
50
|
-
```
|
50
|
+
```
|
51
|
+
>activity_main.xml の<Buttonの中に
|
52
|
+
>以下の2行を入れることでエミュレーターでもPreviewどおり中心に配置できました
|
53
|
+
```
|
54
|
+
|
55
|
+
app:layout_constraintBottom_toBottomOf="parent"
|
56
|
+
app:layout_constraintTop_toTopOf="parent"
|
57
|
+
```
|
58
|
+
](95c6aaa8c5363f324c36dd74eb65dabb.png)
|
3
コードを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,4 +3,48 @@
|
|
3
3
|
一枚目の画像のようにボタンを配置したいのですが、エミュレーターで見ると二枚目の画像のようになってしまいます。
|
4
4
|
xmlのページでポンの部分をマウスで動かして配置しました。
|
5
5
|
xmlのページの右上にエラーメッセージでポンのボタンの座標について書かれていましたが消してしまいました。
|
6
|
-
ログに異常はありませんでした。
|
6
|
+
ログに異常はありませんでした。
|
7
|
+
activity_main.xml
|
8
|
+
```
|
9
|
+
<?xml version="1.0" encoding="utf-8"?>
|
10
|
+
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
11
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
12
|
+
xmlns:tools="http://schemas.android.com/tools"
|
13
|
+
android:layout_width="match_parent"
|
14
|
+
android:layout_height="match_parent"
|
15
|
+
tools:context="com.example.myfirstapp.MainActivity">
|
16
|
+
|
17
|
+
<TextView
|
18
|
+
android:layout_width="wrap_content"
|
19
|
+
android:layout_height="wrap_content"
|
20
|
+
android:text="@string/title_janken"
|
21
|
+
android:textAppearance="@android:style/TextAppearance.Large"
|
22
|
+
app:layout_constraintBottom_toBottomOf="parent"
|
23
|
+
app:layout_constraintLeft_toLeftOf="parent"
|
24
|
+
app:layout_constraintRight_toRightOf="parent"
|
25
|
+
app:layout_constraintTop_toTopOf="parent"
|
26
|
+
app:layout_constraintHorizontal_bias="0.038"
|
27
|
+
app:layout_constraintVertical_bias="0.006" />
|
28
|
+
|
29
|
+
<Button
|
30
|
+
android:id="@+id/button"
|
31
|
+
android:layout_width="wrap_content"
|
32
|
+
android:layout_height="wrap_content"
|
33
|
+
android:onClick="onDuel"
|
34
|
+
android:text="@string/button_showsign"
|
35
|
+
android:textAppearance="@android:style/TextAppearance.Large"
|
36
|
+
tools:layout_editor_absoluteX="136dp"
|
37
|
+
tools:layout_editor_absoluteY="220dp"
|
38
|
+
tools:ignore="MissingConstraints" />
|
39
|
+
|
40
|
+
</android.support.constraint.ConstraintLayout>
|
41
|
+
|
42
|
+
```
|
43
|
+
strings.xml
|
44
|
+
```
|
45
|
+
<resources>
|
46
|
+
<string name="app_name">My FirstApp</string>
|
47
|
+
<string name="title_janken">じゃんけんゲーム</string>
|
48
|
+
<string name="button_showsign">ポン</string>
|
49
|
+
</resources>
|
50
|
+
```
|
2
url削除
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|

|
2
2
|
###前提・実現したいこと
|
3
3
|
一枚目の画像のようにボタンを配置したいのですが、エミュレーターで見ると二枚目の画像のようになってしまいます。
|
4
|
-
https://gyazo.com/12a7be8c7fb3e421df86f931b3a34002
|
5
|
-
https://gyazo.com/c6fdb8f4b56c412ec19a752a454a3443
|
6
4
|
xmlのページでポンの部分をマウスで動かして配置しました。
|
7
5
|
xmlのページの右上にエラーメッセージでポンのボタンの座標について書かれていましたが消してしまいました。
|
8
6
|
ログに異常はありませんでした。
|
1
画像の表示を変えた
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+

|
1
2
|
###前提・実現したいこと
|
2
3
|
一枚目の画像のようにボタンを配置したいのですが、エミュレーターで見ると二枚目の画像のようになってしまいます。
|
3
4
|
https://gyazo.com/12a7be8c7fb3e421df86f931b3a34002
|