質問編集履歴
1
頂いたxmlでのプログラム部分の確認
title
CHANGED
File without changes
|
body
CHANGED
@@ -11,9 +11,8 @@
|
|
11
11
|
また、注意点や、この方法より効率の良い方法がありましたら、
|
12
12
|
ご教授いただきたいです。
|
13
13
|
以下はサイトを参考に作成した、エラーする現在のC#コードです。
|
14
|
-
|
15
14
|
```C#
|
16
|
-
|
15
|
+
//変更前
|
17
16
|
//Activityクラス
|
18
17
|
namespace Tes
|
19
18
|
{
|
@@ -64,4 +63,58 @@
|
|
64
63
|
}
|
65
64
|
}
|
66
65
|
}
|
66
|
+
```
|
67
|
+
|
68
|
+
###追記
|
69
|
+
|
70
|
+
xmlファイルの
|
71
|
+
<jpeg2000testp.jpeg2000test.View_C
|
72
|
+
の部分で「要素RelativeLayoutには無効な子要素~」
|
73
|
+
というエラーが出てきてしまいました。
|
74
|
+
これがxamarinのバージョンの差の違い部分でしょうか?
|
75
|
+
頂いたxmlをそのまま使えるように作成したプログラムを記載しますので、
|
76
|
+
確認していただけますか?
|
77
|
+
xamarin.andoroidのバージョンは6.1.0.71でした。
|
78
|
+
```C#
|
79
|
+
//仮作成
|
80
|
+
//MainActivity.cs
|
81
|
+
namespace jpeg2000test
|
82
|
+
{
|
83
|
+
[Activity(Label = "jpeg2000test", MainLauncher = true, Icon = "@drawable/icon")]
|
84
|
+
public class MainActivity : Activity
|
85
|
+
{
|
86
|
+
protected override void OnCreate(Bundle bundle)
|
87
|
+
{
|
88
|
+
base.OnCreate(bundle);
|
89
|
+
|
90
|
+
RequestWindowFeature(WindowFeatures.NoTitle);
|
91
|
+
|
92
|
+
SetContentView(Resource.Layout.Main);
|
93
|
+
|
94
|
+
btnOne.Click += (object sender, EventArgs e) => {
|
95
|
+
//ここに処理
|
96
|
+
};
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
//View_C.cs
|
102
|
+
namespace jpeg2000test
|
103
|
+
{
|
104
|
+
[Register("jpeg2000testp.jpeg2000test.View_C")]
|
105
|
+
public class View_C : View
|
106
|
+
{
|
107
|
+
//略
|
108
|
+
public View_C(Context context) : base(context)
|
109
|
+
{
|
110
|
+
//略
|
111
|
+
}
|
112
|
+
|
113
|
+
public override void Draw(Canvas canvas)
|
114
|
+
{
|
115
|
+
//canvas.DrawBitmap(Img000, Rect1, Rect2, null);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
67
120
|
```
|