質問編集履歴

1

頂いたxmlでのプログラム部分の確認

2016/09/01 05:45

投稿

tokage
tokage

スコア10

test CHANGED
File without changes
test CHANGED
@@ -24,11 +24,9 @@
24
24
 
25
25
  以下はサイトを参考に作成した、エラーする現在のC#コードです。
26
26
 
27
-
28
-
29
27
  ```C#
30
28
 
31
-
29
+ //変更前
32
30
 
33
31
  //Activityクラス
34
32
 
@@ -131,3 +129,111 @@
131
129
  }
132
130
 
133
131
  ```
132
+
133
+
134
+
135
+ ###追記
136
+
137
+
138
+
139
+ xmlファイルの
140
+
141
+ <jpeg2000testp.jpeg2000test.View_C
142
+
143
+ の部分で「要素RelativeLayoutには無効な子要素~」
144
+
145
+ というエラーが出てきてしまいました。
146
+
147
+ これがxamarinのバージョンの差の違い部分でしょうか?
148
+
149
+ 頂いたxmlをそのまま使えるように作成したプログラムを記載しますので、
150
+
151
+ 確認していただけますか?
152
+
153
+ xamarin.andoroidのバージョンは6.1.0.71でした。
154
+
155
+ ```C#
156
+
157
+ //仮作成
158
+
159
+ //MainActivity.cs
160
+
161
+ namespace jpeg2000test
162
+
163
+ {
164
+
165
+ [Activity(Label = "jpeg2000test", MainLauncher = true, Icon = "@drawable/icon")]
166
+
167
+ public class MainActivity : Activity
168
+
169
+ {
170
+
171
+ protected override void OnCreate(Bundle bundle)
172
+
173
+ {
174
+
175
+ base.OnCreate(bundle);
176
+
177
+
178
+
179
+ RequestWindowFeature(WindowFeatures.NoTitle);
180
+
181
+
182
+
183
+ SetContentView(Resource.Layout.Main);
184
+
185
+
186
+
187
+ btnOne.Click += (object sender, EventArgs e) => {
188
+
189
+ //ここに処理
190
+
191
+ };
192
+
193
+ }
194
+
195
+ }
196
+
197
+ }
198
+
199
+
200
+
201
+ //View_C.cs
202
+
203
+ namespace jpeg2000test
204
+
205
+ {
206
+
207
+ [Register("jpeg2000testp.jpeg2000test.View_C")]
208
+
209
+ public class View_C : View
210
+
211
+ {
212
+
213
+ //略
214
+
215
+ public View_C(Context context) : base(context)
216
+
217
+ {
218
+
219
+ //略
220
+
221
+ }
222
+
223
+
224
+
225
+ public override void Draw(Canvas canvas)
226
+
227
+ {
228
+
229
+ //canvas.DrawBitmap(Img000, Rect1, Rect2, null);
230
+
231
+ }
232
+
233
+ }
234
+
235
+ }
236
+
237
+
238
+
239
+ ```