@@ -73,15 +73,15 @@ public NativeListPage ()
73
73
74
74
// The root page of your application
75
75
Content = new StackLayout {
76
- Padding = new Thickness ( 0 , Device . OnPlatform ( 20 , 0 , 0 ) , 0 , 0 ) ,
76
+ Padding = Device . RuntimePlatform == Device . iOS ? new Thickness ( 0 , 20 , 0 , 0 ) : new Thickness ( 0 ) ,
77
77
Children = {
78
78
new Label {
79
79
#pragma warning disable 618
80
80
XAlign = TextAlignment . Center ,
81
81
#pragma warning restore 618
82
- Text = Device . OnPlatform ( "Custom renderer UITableView" , "Custom renderer ListView" , "Custom renderer todo" )
82
+ Text = Device . RuntimePlatform == Device . iOS ? "Custom renderer UITableView" : Device . RuntimePlatform == Device . Android ? "Custom renderer ListView" : "Custom renderer todo"
83
83
} ,
84
- fasterListView
84
+ fasterListView
85
85
}
86
86
} ;
87
87
}
@@ -143,7 +143,7 @@ public XamarinFormsPage ()
143
143
} ;
144
144
145
145
Content = new StackLayout {
146
- Padding = new Thickness ( 5 , Device . OnPlatform ( 20 , 0 , 0 ) , 5 , 0 ) ,
146
+ Padding = Device . RuntimePlatform == Device . iOS ? new Thickness ( 5 , 20 , 5 , 0 ) : new Thickness ( 5 , 0 ) ,
147
147
Children = {
148
148
new Label {
149
149
#pragma warning disable 618
@@ -185,7 +185,7 @@ public XamarinFormsNativeCellPage ()
185
185
} ;
186
186
187
187
Content = new StackLayout {
188
- Padding = new Thickness ( 0 , Device . OnPlatform ( 20 , 0 , 0 ) , 0 , 0 ) ,
188
+ Padding = Device . RuntimePlatform == Device . iOS ? new Thickness ( 0 , 20 , 0 , 0 ) : new Thickness ( 0 ) ,
189
189
Children = {
190
190
new Label {
191
191
#pragma warning disable 618
@@ -250,7 +250,7 @@ public DetailPage (object detail)
250
250
b . Clicked += ( sender , e ) => Navigation . PopModalAsync ( ) ;
251
251
252
252
Content = new StackLayout {
253
- Padding = new Thickness ( 0 , Device . OnPlatform ( 20 , 0 , 0 ) , 0 , 0 ) ,
253
+ Padding = Device . RuntimePlatform == Device . iOS ? new Thickness ( 0 , 20 , 0 , 0 ) : new Thickness ( 0 ) ,
254
254
HorizontalOptions = LayoutOptions . Center ,
255
255
VerticalOptions = LayoutOptions . Center ,
256
256
Children = {
@@ -289,13 +289,13 @@ public NativeListViewPage2 ()
289
289
290
290
// The root page of your application
291
291
Content = new StackLayout {
292
- Padding = new Thickness ( 0 , Device . OnPlatform ( 20 , 0 , 0 ) , 0 , 0 ) ,
292
+ Padding = Device . RuntimePlatform == Device . iOS ? new Thickness ( 0 , 20 , 0 , 0 ) : new Thickness ( 0 ) ,
293
293
Children = {
294
294
new Label {
295
295
#pragma warning disable 618
296
296
XAlign = TextAlignment . Center ,
297
297
#pragma warning restore 618
298
- Text = Device . OnPlatform ( "Custom UITableView+UICell" , "Custom ListView+Cell" , "Custom renderer todo" )
298
+ Text = Device . RuntimePlatform == Device . iOS ? "Custom UITableView+UICell" : Device . RuntimePlatform == Device . Android ? "Custom ListView+Cell" : "Custom renderer todo"
299
299
} ,
300
300
nativeListView2
301
301
}
0 commit comments