質問編集履歴

4

追記

2017/03/25 01:21

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -97,3 +97,19 @@
97
97
  </resources>
98
98
 
99
99
  ```
100
+
101
+ >activity_main.xml の<Buttonの中に
102
+
103
+ >以下の2行を入れることでエミュレーターでもPreviewどおり中心に配置できました
104
+
105
+ ```
106
+
107
+
108
+
109
+ app:layout_constraintBottom_toBottomOf="parent"
110
+
111
+ app:layout_constraintTop_toTopOf="parent"
112
+
113
+ ```
114
+
115
+ ![![イメージ説明](d8c1aa451c3178c9c3d5c69c9b6fd61d.png)](95c6aaa8c5363f324c36dd74eb65dabb.png)

3

コードを追加

2017/03/25 01:21

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -9,3 +9,91 @@
9
9
  xmlのページの右上にエラーメッセージでポンのボタンの座標について書かれていましたが消してしまいました。
10
10
 
11
11
  ログに異常はありませんでした。
12
+
13
+ activity_main.xml
14
+
15
+ ```
16
+
17
+ <?xml version="1.0" encoding="utf-8"?>
18
+
19
+ <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
20
+
21
+ xmlns:app="http://schemas.android.com/apk/res-auto"
22
+
23
+ xmlns:tools="http://schemas.android.com/tools"
24
+
25
+ android:layout_width="match_parent"
26
+
27
+ android:layout_height="match_parent"
28
+
29
+ tools:context="com.example.myfirstapp.MainActivity">
30
+
31
+
32
+
33
+ <TextView
34
+
35
+ android:layout_width="wrap_content"
36
+
37
+ android:layout_height="wrap_content"
38
+
39
+ android:text="@string/title_janken"
40
+
41
+ android:textAppearance="@android:style/TextAppearance.Large"
42
+
43
+ app:layout_constraintBottom_toBottomOf="parent"
44
+
45
+ app:layout_constraintLeft_toLeftOf="parent"
46
+
47
+ app:layout_constraintRight_toRightOf="parent"
48
+
49
+ app:layout_constraintTop_toTopOf="parent"
50
+
51
+ app:layout_constraintHorizontal_bias="0.038"
52
+
53
+ app:layout_constraintVertical_bias="0.006" />
54
+
55
+
56
+
57
+ <Button
58
+
59
+ android:id="@+id/button"
60
+
61
+ android:layout_width="wrap_content"
62
+
63
+ android:layout_height="wrap_content"
64
+
65
+ android:onClick="onDuel"
66
+
67
+ android:text="@string/button_showsign"
68
+
69
+ android:textAppearance="@android:style/TextAppearance.Large"
70
+
71
+ tools:layout_editor_absoluteX="136dp"
72
+
73
+ tools:layout_editor_absoluteY="220dp"
74
+
75
+ tools:ignore="MissingConstraints" />
76
+
77
+
78
+
79
+ </android.support.constraint.ConstraintLayout>
80
+
81
+
82
+
83
+ ```
84
+
85
+ strings.xml
86
+
87
+ ```
88
+
89
+ <resources>
90
+
91
+ <string name="app_name">My FirstApp</string>
92
+
93
+ <string name="title_janken">じゃんけんゲーム</string>
94
+
95
+ <string name="button_showsign">ポン</string>
96
+
97
+ </resources>
98
+
99
+ ```

2

url削除

2017/03/24 16:49

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -4,10 +4,6 @@
4
4
 
5
5
  一枚目の画像のようにボタンを配置したいのですが、エミュレーターで見ると二枚目の画像のようになってしまいます。
6
6
 
7
- https://gyazo.com/12a7be8c7fb3e421df86f931b3a34002
8
-
9
- https://gyazo.com/c6fdb8f4b56c412ec19a752a454a3443
10
-
11
7
  xmlのページでポンの部分をマウスで動かして配置しました。
12
8
 
13
9
  xmlのページの右上にエラーメッセージでポンのボタンの座標について書かれていましたが消してしまいました。

1

画像の表示を変えた

2017/03/24 16:34

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,5 @@
1
+ ![イメージ説明](99a6eb7241f2ad5ecf6a45a427a25635.png)![イメージ説明](22f4192a4c9a3026e96c7803f7dffc81.png)
2
+
1
3
  ###前提・実現したいこと
2
4
 
3
5
  一枚目の画像のようにボタンを配置したいのですが、エミュレーターで見ると二枚目の画像のようになってしまいます。