Android studio を使い初めて1ヶ月の初心者です。
今までテーブルレイアウトをその都度作って、利用していたのですが、同じ記述が複数並んだためincludeを使用することにしました。
includeのTextView内に別々の値を、入れたいのですがどのように記述したら良いでしょう。
初歩的な質問ですが、ご教授よろしくお願いします。
Java
1 <TableLayout 2 android:id="@+id/tableLayout" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:background="@drawable/frame_style" 6 app:layout_constraintBottom_toBottomOf="parent" 7 app:layout_constraintEnd_toEndOf="parent" 8 app:layout_constraintStart_toStartOf="parent" 9 app:layout_constraintTop_toTopOf="parent"> 10 11 <TableRow 12 android:layout_width="match_parent" 13 android:layout_height="match_parent" 14 android:background="@drawable/frame_style"> 15 16 <TextView 17 android:id="@+id/textView3" 18 android:layout_width="match_parent" 19 android:layout_height="wrap_content" 20 android:background="@drawable/frame_style" 21 android:text="" 22 android:textAlignment="center" 23 android:textColor="#000" 24 android:textSize="24sp" 25 android:textStyle="bold" /> 26 </TableRow> 27 28 <TableRow 29 android:layout_width="match_parent" 30 android:layout_height="match_parent" 31 android:background="@drawable/frame_style"> 32 33 <TextView 34 android:id="@+id/textView2" 35 android:layout_width="wrap_content" 36 android:layout_height="wrap_content" 37 android:background="@drawable/frame_style" 38 android:text="" 39 android:textAlignment="center" 40 android:textColor="#000" 41 android:textSize="18sp" /> 42 43 </TableRow> 44 45 <TableRow 46 android:layout_width="match_parent" 47 android:layout_height="match_parent" 48 android:background="@drawable/frame_style"> 49 50 <TextView 51 android:id="@+id/textView6" 52 android:layout_width="wrap_content" 53 android:layout_height="match_parent" 54 android:background="@drawable/frame_style" 55 android:text="" 56 android:textAlignment="center" 57 android:textColor="#000" 58 android:textSize="24sp" 59 android:textStyle="bold" /> 60 61 </TableRow> 62 63 <TableRow 64 android:layout_width="match_parent" 65 android:layout_height="match_parent" 66 android:background="@drawable/frame_style"> 67 68 <TextView 69 android:id="@+id/textView7" 70 android:layout_width="wrap_content" 71 android:layout_height="wrap_content" 72 android:background="@drawable/frame_style" 73 android:text="" 74 android:textAlignment="textStart" 75 android:textColor="#000" 76 android:textSize="18sp" /> 77 78 </TableRow> 79 80 <TableRow 81 android:layout_width="match_parent" 82 android:layout_height="match_parent" 83 android:background="@drawable/frame_style"> 84 85 <TextView 86 android:id="@+id/textView29" 87 android:layout_width="wrap_content" 88 android:layout_height="match_parent" 89 android:background="@drawable/frame_style" 90 android:text="" 91 android:textAlignment="center" 92 android:textColor="#000" 93 android:textSize="24sp" 94 android:textStyle="bold" /> 95 </TableRow> 96 97 <TableRow 98 android:layout_width="match_parent" 99 android:layout_height="match_parent" 100 android:background="@drawable/frame_style"> 101 102 <TextView 103 android:id="@+id/textView30" 104 android:layout_width="wrap_content" 105 android:layout_height="wrap_content" 106 android:background="@drawable/frame_style" 107 android:text="" 108 android:textAlignment="textStart" 109 android:textColor="#000" 110 android:textSize="18sp" /> 111 </TableRow> 112 113 <TableRow 114 android:layout_width="215dp" 115 android:layout_height="match_parent" 116 android:background="@drawable/frame_style"> 117 118 <TextView 119 android:id="@+id/textView5" 120 android:layout_width="0dp" 121 android:layout_height="wrap_content" 122 android:layout_weight="1" 123 android:background="@drawable/frame_style" 124 android:text="" 125 android:textAlignment="center" 126 android:textColor="#000" 127 android:textSize="24sp" 128 android:textStyle="bold" /> 129 130 <TextView 131 android:id="@+id/textView9" 132 android:layout_width="0dp" 133 android:layout_height="match_parent" 134 android:layout_weight="1" 135 android:background="@drawable/frame_style" 136 android:text="" 137 android:textAlignment="center" 138 android:textColor="#000" 139 android:textSize="18sp" /> 140 141 <TextView 142 android:id="@+id/textView8" 143 android:layout_width="0dp" 144 android:layout_height="match_parent" 145 android:layout_weight="1" 146 android:background="@drawable/frame_style" 147 android:text="" 148 android:textAlignment="center" 149 android:textColor="#000" 150 android:textSize="18sp" /> 151 </TableRow> 152 153 <TableRow 154 android:layout_width="match_parent" 155 android:layout_height="match_parent" 156 android:background="@drawable/frame_style"> 157 158 <TextView 159 android:id="@+id/textView4" 160 android:layout_width="0dp" 161 android:layout_height="wrap_content" 162 android:layout_weight="1" 163 android:background="@drawable/frame_style" 164 android:text="" 165 android:textAlignment="center" 166 android:textColor="#000" 167 android:textSize="24sp" 168 android:textStyle="bold" /> 169 170 <TextView 171 android:id="@+id/textView11" 172 android:layout_width="0dp" 173 android:layout_height="wrap_content" 174 android:layout_weight="1" 175 android:background="@drawable/frame_style" 176 android:text="" 177 android:textColor="#000" 178 android:textSize="24sp" 179 android:textStyle="bold" /> 180 </TableRow> 181 182 <TableRow 183 android:layout_width="match_parent" 184 android:layout_height="match_parent" 185 android:background="@drawable/frame_style"> 186 187 <TextView 188 android:id="@+id/textView10" 189 android:layout_width="0dp" 190 android:layout_height="wrap_content" 191 android:layout_weight="1" 192 android:text="" 193 android:textColor="#000" 194 android:textSize="18sp" /> 195 196 <TextView 197 android:id="@+id/textView12" 198 android:layout_width="0dp" 199 android:layout_height="wrap_content" 200 android:layout_weight="1" 201 android:text="" 202 android:textColor="#000" 203 android:textSize="18sp" /> 204 </TableRow> 205 206 <TableRow 207 android:layout_width="match_parent" 208 android:layout_height="match_parent" 209 android:background="@drawable/frame_style"> 210 211 <TextView 212 android:id="@+id/textView13" 213 android:layout_width="wrap_content" 214 android:background="@drawable/frame_style" 215 android:text="" 216 android:textAlignment="center" 217 android:textColor="#000" 218 android:textSize="24sp" 219 android:textStyle="bold" /> 220 221 </TableRow> 222 223 <TableRow 224 android:layout_width="match_parent" 225 android:layout_height="match_parent"> 226 227 <TextView 228 android:id="@+id/textView14" 229 android:layout_width="0dp" 230 android:layout_height="wrap_content" 231 android:layout_weight="1" 232 android:text="" 233 android:textAlignment="center" 234 android:textColor="#000" 235 android:textSize="18sp" 236 android:textStyle="bold" /> 237 </TableRow> 238 239 </TableLayout>
回答1件
あなたの回答
tips
プレビュー