teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

activity_main.xmlを貼りました。

2021/08/04 05:41

投稿

f25gm
f25gm

スコア5

title CHANGED
File without changes
body CHANGED
@@ -101,7 +101,46 @@
101
101
 
102
102
  </manifest>
103
103
  ```
104
+ ```ここに言語を入力
105
+ <?xml version="1.0" encoding="utf-8"?>
106
+ <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
107
+ xmlns:app="http://schemas.android.com/apk/res-auto"
108
+ xmlns:tools="http://schemas.android.com/tools"
109
+ android:id="@+id/messageTextView"
110
+ android:layout_width="match_parent"
111
+ android:layout_height="match_parent"
112
+ tools:context=".MainActivity">
104
113
 
114
+ <TextView
115
+ android:id="@+id/textView"
116
+ android:layout_width="68dp"
117
+ android:layout_height="35dp"
118
+ android:text="@string/message_text"
119
+ android:textSize="36sp"
120
+ android:textStyle="bold"
121
+ app:layout_constraintBottom_toBottomOf="parent"
122
+ app:layout_constraintEnd_toEndOf="parent"
123
+ app:layout_constraintHorizontal_bias="0.5"
124
+ app:layout_constraintStart_toStartOf="parent"
125
+ app:layout_constraintTop_toTopOf="parent" />
126
+
127
+ <Button
128
+ android:id="@+id/changeButton"
129
+ android:layout_width="wrap_content"
130
+ android:layout_height="wrap_content"
131
+ android:layout_marginTop="32dp"
132
+ android:onClick="changeTextView"
133
+ android:text="@string/button_text"
134
+ app:layout_constraintBottom_toBottomOf="parent"
135
+ app:layout_constraintEnd_toEndOf="parent"
136
+ app:layout_constraintHorizontal_bias="0.498"
137
+ app:layout_constraintStart_toStartOf="parent"
138
+ app:layout_constraintTop_toBottomOf="@+id/textView"
139
+ app:layout_constraintVertical_bias="0.24" />
140
+
141
+ </androidx.constraintlayout.widget.ConstraintLayout>
142
+ ```
143
+
105
144
  ### 試したこと
106
145
 
107
146
  配置されているものがtextViewではないのではないかとの

1

markdown機能を使ってコードを上げなおしました。

2021/08/04 05:41

投稿

f25gm
f25gm

スコア5

title CHANGED
File without changes
body CHANGED
@@ -10,7 +10,7 @@
10
10
  unresolved reference text
11
11
 
12
12
  ### 該当のソースコード
13
-
13
+ ```ここに言語を入力
14
14
  package com.example.myfirstapp
15
15
 
16
16
  import androidx.appcompat.app.AppCompatActivity
@@ -28,8 +28,8 @@
28
28
  messageTextView.text = "hello threre"
29
29
  }
30
30
  }
31
-
31
+ ```
32
-
32
+ ```ここに言語を入力
33
33
  plugins {
34
34
  id 'com.android.application'
35
35
  id 'kotlin-android'
@@ -74,7 +74,9 @@
74
74
  androidTestImplementation 'androidx.test.ext:junit:1.1.2'
75
75
  androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
76
76
  }
77
+ ```
77
78
 
79
+ ```ここに言語を入力
78
80
  <?xml version="1.0" encoding="utf-8"?>
79
81
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
80
82
  package="com.example.myfirstapp">
@@ -98,6 +100,8 @@
98
100
  </application>
99
101
 
100
102
  </manifest>
103
+ ```
104
+
101
105
  ### 試したこと
102
106
 
103
107
  配置されているものがtextViewではないのではないかとの