質問編集履歴

4

Xamarin\.Formsの内容追記

2017/01/31 11:52

投稿

nasama
nasama

スコア16

test CHANGED
File without changes
test CHANGED
@@ -92,56 +92,144 @@
92
92
 
93
93
  回答ありがとうございます。
94
94
 
95
- 現状axmlはこのような形ですが、NavigationPageはどように加えればよろしいしょうか?
96
-
97
- Visual Studioのツールボックスにもそれらしきものが見当たらなかったのですが、外部からダウンロードする必要がありますか?
98
-
99
- ```
100
-
101
- <?xml version="1.0" encoding="utf-8"?>
102
-
103
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
104
-
105
- android:orientation="vertical"
106
-
107
- android:layout_width="match_parent"
108
-
109
- android:layout_height="match_parent" />
110
-
111
- ```
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- 現状試した
120
-
121
-
122
-
123
- ```
124
-
125
- <?xml version="1.0" encoding="utf-8"?>
126
-
127
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
128
-
129
- android:orientation="vertical"
130
-
131
- android:layout_width="match_parent"
132
-
133
- android:layout_height="match_parent">
134
-
135
- <NavigationPage
136
-
137
- android:orientation="vertical"
138
-
139
- android:layout_width="match_parent"
140
-
141
- android:layout_height="match_parent" />
142
-
143
- </LinearLayout>
144
-
145
- ```
146
-
147
- ですが、エラーが表示されます。
95
+ Xamarin.Android方法すと、
96
+
97
+ ```
98
+
99
+ No resource found that matches the given name: attr 'windowNoTitle'.
100
+
101
+ No resource found that matches the given name: attr 'windowActionBar'.
102
+
103
+ Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.Light'.
104
+
105
+ ```
106
+
107
+ とエラーが表示されてしまい、コード内からクイックアクションやリファクタリングもできず、解決方法がわからなかったので断念しました。
108
+
109
+ Xamarin.Formsではないと使用できないとのことでしたので、Xamarin.Formsで作成しなおしました。
110
+
111
+ エラーは消えましたが、画面はNavigationPage.SetHasNavigationBar(this, false);を入れる前と変わらず、どこにコードを書いてよいかわからない状態です。またxamlファイルがないので、編集部分がわからない状態です。
112
+
113
+
114
+
115
+ 現在以下の状態です。手探りですが、エラーが出ない場所にNavigationPage.SetHasNavigationBar(this, false);を入れました。
116
+
117
+ MainActivity.csにはどこに入れても「CS1503 引数 1: は 'XFApp3.Droid.MainActivity' から 'Xamarin.Forms.BindableObject' へ変換することはできません。」
118
+
119
+ と、エラーが出てまったので編集していません。
120
+
121
+
122
+
123
+ App.cs
124
+
125
+ ```
126
+
127
+ using System;
128
+
129
+ using System.Collections.Generic;
130
+
131
+ using System.Linq;
132
+
133
+ using System.Text;
134
+
135
+
136
+
137
+ using Xamarin.Forms;
138
+
139
+
140
+
141
+ namespace XFApp3
142
+
143
+ {
144
+
145
+
146
+
147
+ public class App : Application
148
+
149
+ {
150
+
151
+ public App()
152
+
153
+ {
154
+
155
+ NavigationPage.SetHasNavigationBar(this, false);
156
+
157
+ // The root page of your application
158
+
159
+ NavigationPage.SetHasNavigationBar(this, false);
160
+
161
+ MainPage = new ContentPage
162
+
163
+ {
164
+
165
+
166
+
167
+ Content = new StackLayout
168
+
169
+ {
170
+
171
+ VerticalOptions = LayoutOptions.Center,
172
+
173
+
174
+
175
+ Children = {
176
+
177
+ new Label {
178
+
179
+ HorizontalTextAlignment = TextAlignment.Center,
180
+
181
+ Text = "Welcome to Xamarin Forms!"
182
+
183
+ }
184
+
185
+ }
186
+
187
+ }
188
+
189
+ };
190
+
191
+ NavigationPage.SetHasNavigationBar(this, false);
192
+
193
+ }
194
+
195
+
196
+
197
+ protected override void OnStart()
198
+
199
+ {
200
+
201
+ NavigationPage.SetHasNavigationBar(this, false);
202
+
203
+ // Handle when your app starts
204
+
205
+ }
206
+
207
+
208
+
209
+ protected override void OnSleep()
210
+
211
+ {
212
+
213
+ NavigationPage.SetHasNavigationBar(this, false);
214
+
215
+ // Handle when your app sleeps
216
+
217
+ }
218
+
219
+
220
+
221
+ protected override void OnResume()
222
+
223
+ {
224
+
225
+ NavigationPage.SetHasNavigationBar(this, false);
226
+
227
+ // Handle when your app resumes
228
+
229
+ }
230
+
231
+ }
232
+
233
+ }
234
+
235
+ ```

3

綴り間違いがあったので修正

2017/01/31 11:52

投稿

nasama
nasama

スコア16

test CHANGED
File without changes
test CHANGED
@@ -132,7 +132,7 @@
132
132
 
133
133
  android:layout_height="match_parent">
134
134
 
135
- <NavigaionPage
135
+ <NavigationPage
136
136
 
137
137
  android:orientation="vertical"
138
138
 

2

axmlの内容をの記述が明らかに間違えていたので修正

2017/01/27 12:49

投稿

nasama
nasama

スコア16

test CHANGED
File without changes
test CHANGED
@@ -130,15 +130,17 @@
130
130
 
131
131
  android:layout_width="match_parent"
132
132
 
133
- android:layout_height="match_parent" />
133
+ android:layout_height="match_parent">
134
134
 
135
- <NavigaionPage xmlns:android="http://schemas.android.com/apk/res/android"
135
+ <NavigaionPage
136
136
 
137
- android:orientation="vertical"
137
+ android:orientation="vertical"
138
138
 
139
- android:layout_width="match_parent"
139
+ android:layout_width="match_parent"
140
140
 
141
- android:layout_height="match_parent" />
141
+ android:layout_height="match_parent" />
142
+
143
+ </LinearLayout>
142
144
 
143
145
  ```
144
146
 

1

axmlの内容と、試したことを追記

2017/01/27 12:46

投稿

nasama
nasama

スコア16

test CHANGED
File without changes
test CHANGED
@@ -83,3 +83,63 @@
83
83
 
84
84
 
85
85
  ```
86
+
87
+
88
+
89
+
90
+
91
+ ###追記
92
+
93
+ 回答ありがとうございます。
94
+
95
+ 現状axmlはこのような形ですが、NavigationPageはどのように加えればよろしいでしょうか?
96
+
97
+ Visual Studioのツールボックスにもそれらしきものが見当たらなかったのですが、外部からダウンロードする必要がありますか?
98
+
99
+ ```
100
+
101
+ <?xml version="1.0" encoding="utf-8"?>
102
+
103
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
104
+
105
+ android:orientation="vertical"
106
+
107
+ android:layout_width="match_parent"
108
+
109
+ android:layout_height="match_parent" />
110
+
111
+ ```
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ 現状試したものは
120
+
121
+
122
+
123
+ ```
124
+
125
+ <?xml version="1.0" encoding="utf-8"?>
126
+
127
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
128
+
129
+ android:orientation="vertical"
130
+
131
+ android:layout_width="match_parent"
132
+
133
+ android:layout_height="match_parent" />
134
+
135
+ <NavigaionPage xmlns:android="http://schemas.android.com/apk/res/android"
136
+
137
+ android:orientation="vertical"
138
+
139
+ android:layout_width="match_parent"
140
+
141
+ android:layout_height="match_parent" />
142
+
143
+ ```
144
+
145
+ ですが、エラーが表示されます。