質問編集履歴
2
ファイルの拡張子について追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
原因は何なのでしょうか。
|
6
6
|
|
7
|
+
表示したい画像の拡張子はjpgです。
|
8
|
+
|
7
9
|
```XML
|
8
10
|
|
9
11
|
<?xml version="1.0" encoding="utf-8"?>
|
1
ソースファイルを追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -3,3 +3,209 @@
|
|
3
3
|
エミュレータを使用してデバッグするとしっかりでます。
|
4
4
|
|
5
5
|
原因は何なのでしょうか。
|
6
|
+
|
7
|
+
```XML
|
8
|
+
|
9
|
+
<?xml version="1.0" encoding="utf-8"?>
|
10
|
+
|
11
|
+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
12
|
+
|
13
|
+
xmlns:tools="http://schemas.android.com/tools"
|
14
|
+
|
15
|
+
android:layout_width="match_parent"
|
16
|
+
|
17
|
+
android:layout_height="match_parent"
|
18
|
+
|
19
|
+
tools:context="com.example.keiju.proto.Login"
|
20
|
+
|
21
|
+
android:background="#3b5aff">
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
<ImageView
|
26
|
+
|
27
|
+
android:layout_width="match_parent"
|
28
|
+
|
29
|
+
android:layout_height="match_parent"
|
30
|
+
|
31
|
+
android:id="@+id/imageView"
|
32
|
+
|
33
|
+
android:layout_alignParentLeft="true"
|
34
|
+
|
35
|
+
android:layout_alignParentStart="true"
|
36
|
+
|
37
|
+
android:src="@drawable/background"
|
38
|
+
|
39
|
+
android:scaleType="fitXY"/>
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
<RelativeLayout
|
44
|
+
|
45
|
+
android:layout_width="match_parent"
|
46
|
+
|
47
|
+
android:layout_height="match_parent">
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
<Button
|
52
|
+
|
53
|
+
android:layout_width="wrap_content"
|
54
|
+
|
55
|
+
android:layout_height="wrap_content"
|
56
|
+
|
57
|
+
android:text="ログイン"
|
58
|
+
|
59
|
+
android:id="@+id/btn"
|
60
|
+
|
61
|
+
android:layout_marginTop="37dp"
|
62
|
+
|
63
|
+
android:layout_below="@+id/editText2"
|
64
|
+
|
65
|
+
android:layout_centerHorizontal="true" />
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<EditText
|
70
|
+
|
71
|
+
android:layout_width="200dp"
|
72
|
+
|
73
|
+
android:layout_height="wrap_content"
|
74
|
+
|
75
|
+
android:id="@+id/editText"
|
76
|
+
|
77
|
+
android:layout_above="@+id/textView2"
|
78
|
+
|
79
|
+
android:layout_centerHorizontal="true" />
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<TextView
|
84
|
+
|
85
|
+
android:layout_width="wrap_content"
|
86
|
+
|
87
|
+
android:layout_height="wrap_content"
|
88
|
+
|
89
|
+
android:textAppearance="?android:attr/textAppearanceLarge"
|
90
|
+
|
91
|
+
android:text="ID"
|
92
|
+
|
93
|
+
android:id="@+id/textView"
|
94
|
+
|
95
|
+
android:layout_gravity="center_horizontal"
|
96
|
+
|
97
|
+
android:textColor="#000000"
|
98
|
+
|
99
|
+
android:layout_above="@+id/editText"
|
100
|
+
|
101
|
+
android:layout_centerHorizontal="true" />
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<TextView
|
106
|
+
|
107
|
+
android:layout_width="wrap_content"
|
108
|
+
|
109
|
+
android:layout_height="wrap_content"
|
110
|
+
|
111
|
+
android:textAppearance="?android:attr/textAppearanceLarge"
|
112
|
+
|
113
|
+
android:text="PASSWORD"
|
114
|
+
|
115
|
+
android:id="@+id/textView2"
|
116
|
+
|
117
|
+
android:textColor="#000000"
|
118
|
+
|
119
|
+
android:layout_above="@+id/editText2"
|
120
|
+
|
121
|
+
android:layout_centerHorizontal="true" />
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<EditText
|
126
|
+
|
127
|
+
android:layout_width="200dp"
|
128
|
+
|
129
|
+
android:layout_height="wrap_content"
|
130
|
+
|
131
|
+
android:inputType="textPassword"
|
132
|
+
|
133
|
+
android:ems="10"
|
134
|
+
|
135
|
+
android:id="@+id/editText2"
|
136
|
+
|
137
|
+
android:layout_centerVertical="true"
|
138
|
+
|
139
|
+
android:layout_alignLeft="@+id/editText"
|
140
|
+
|
141
|
+
android:layout_alignStart="@+id/editText" />
|
142
|
+
|
143
|
+
</RelativeLayout>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
</RelativeLayout>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
```
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
```java
|
156
|
+
|
157
|
+
package com.example.keiju.proto;
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
import android.app.Activity;
|
162
|
+
|
163
|
+
import android.content.Intent;
|
164
|
+
|
165
|
+
import android.support.v7.app.AppCompatActivity;
|
166
|
+
|
167
|
+
import android.os.Bundle;
|
168
|
+
|
169
|
+
import android.view.View;
|
170
|
+
|
171
|
+
import android.widget.Button;
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
public class Login extends Activity {
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
@Override
|
180
|
+
|
181
|
+
protected void onCreate(Bundle savedInstanceState) {
|
182
|
+
|
183
|
+
super.onCreate(savedInstanceState);
|
184
|
+
|
185
|
+
setContentView(R.layout.activity_login);
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
Button btn = (Button)findViewById(R.id.btn);
|
190
|
+
|
191
|
+
btn.setOnClickListener(new View.OnClickListener() {
|
192
|
+
|
193
|
+
@Override
|
194
|
+
|
195
|
+
public void onClick(View v) {
|
196
|
+
|
197
|
+
Intent intent = new Intent(getApplication(),MainActivity.class);
|
198
|
+
|
199
|
+
startActivity(intent);
|
200
|
+
|
201
|
+
}
|
202
|
+
|
203
|
+
});
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
```
|