回答編集履歴

1

iOSのコード追加

2017/04/21 08:52

投稿

yamataka3
yamataka3

スコア145

test CHANGED
@@ -37,3 +37,47 @@
37
37
  }
38
38
 
39
39
  ```
40
+
41
+
42
+
43
+
44
+
45
+ iOSの場合(こちら動作未確認です)
46
+
47
+ ```
48
+
49
+ using Xamarin.Forms;
50
+
51
+ using Xamarin.Forms.Platform.iOS;
52
+
53
+
54
+
55
+ [assembly: ExportRenderer(typeof(WebView), typeof(WebViewTest.iOS.WebViewRenderer))]
56
+
57
+
58
+
59
+ namespace WebViewTest.iOS
60
+
61
+ {
62
+
63
+ public class WebViewRenderer : Xamarin.Forms.Platform.iOS.WebViewRenderer
64
+
65
+ {
66
+
67
+ protected override void OnElementChanged(VisualElementChangedEventArgs e)
68
+
69
+ {
70
+
71
+ base.OnElementChanged(e);
72
+
73
+ ScalesPageToFit = true;
74
+
75
+ ContentMode = UIKit.UIViewContentMode.ScaleAspectFit;
76
+
77
+ }
78
+
79
+ }
80
+
81
+ }
82
+
83
+ ```