@@ -224,69 +224,68 @@ public MainPage()
224
224
#### [ ** Padding (default)** ] ( #tab/padding )
225
225
226
226
Top TabBar:
227
- # [ ** XAML** ] ( #tab/xaml )
227
+ ** XAML**
228
228
``` diff
229
229
<utu:TabBar Background="Purple"
230
230
+ utu:SafeArea.Insets="Top">
231
231
```
232
- # [ ** C#** ] ( #tab/csharp )
232
+ ** C#**
233
233
``` diff
234
234
new TabBar()
235
235
.Background(Colors.Purple)
236
236
+ .SafeArea(SafeArea.InsetMask.Top)
237
237
```
238
- ***
238
+
239
239
Bottom TabBar:
240
- # [ ** XAML** ] ( #tab/xaml )
240
+ ** XAML**
241
241
``` diff
242
242
<utu:TabBar Grid.Row="2"
243
243
+ utu:SafeArea.Insets="Bottom"
244
244
Background="Purple">
245
245
```
246
- # [ ** C#** ] ( #tab/csharp )
246
+ ** C#**
247
247
``` diff
248
248
new TabBar()
249
249
.Grid(row: 2)
250
250
+ .SafeArea(SafeArea.InsetMask.Bottom)
251
251
.Background(Colors.Purple)
252
252
```
253
- ***
253
+
254
254
255
255
![ safearea_with_padding_alpha] ( ../assets/safearea_with_padding.png )
256
256
257
257
#### [ ** Margin** ] ( #tab/margin )
258
258
259
259
Top TabBar:
260
- # [ ** XAML** ] ( #tab/xaml )
260
+ ** XAML**
261
261
``` diff
262
262
<utu:TabBar Background="Purple"
263
263
+ utu:SafeArea.Insets="Top"
264
264
+ utu:SafeArea.Mode="Margin">
265
265
```
266
- # [ ** C#** ] ( #tab/csharp )
266
+ ** C#**
267
267
``` diff
268
268
new TabBar()
269
269
.Background(Colors.Purple)
270
270
+ .SafeArea(SafeArea.InsetMask.Top, SafeArea.InsetMode.Margin)
271
271
```
272
- ***
273
272
274
273
Bottom TabBar:
275
- # [ ** XAML** ] ( #tab/xaml )
274
+ ** XAML**
276
275
``` diff
277
276
<utu:TabBar Grid.Row="2"
278
277
+ utu:SafeArea.Insets="Bottom"
279
278
+ utu:SafeArea.Mode="Margin"
280
279
Background="Purple">
281
280
```
282
- # [ ** C#** ] ( #tab/csharp )
281
+ ** C#**
283
282
``` diff
284
283
new TabBar()
285
284
.Grid(row: 2)
286
285
+ .SafeArea(SafeArea.InsetMask.Bottom, SafeArea.InsetMode.Margin)
287
286
.Background(Colors.Purple)
288
287
```
289
- ***
288
+
290
289
291
290
![ safearea_with_margin_alpha] ( ../assets/safearea_with_margin.png )
292
291
***
@@ -319,7 +318,7 @@ Notice in this first example (without `SafeArea` in use) that the Username and P
319
318
<td ><img src =" ../assets/safearea-login-static.gif " width =" 400px " /> </td >
320
319
<td>
321
320
322
- # [ ** XAML** ] ( #tab/xaml )
321
+ ** XAML**
323
322
``` xml
324
323
<Page xmlns : utu =" using:Uno.Toolkit.UI" ...>
325
324
<Grid Padding =" 50,0" >
@@ -361,7 +360,7 @@ Notice in this first example (without `SafeArea` in use) that the Username and P
361
360
</Grid >
362
361
</Page >
363
362
```
364
- # [ ** C#** ] ( #tab/csharp )
363
+ ** C#**
365
364
``` cs
366
365
new Grid ()
367
366
.Padding (new Thickness (50 ,0 ,50 ,0 ))
@@ -406,7 +405,7 @@ new Grid()
406
405
)
407
406
408
407
```
409
- ***
408
+
410
409
</td >
411
410
</tr >
412
411
</table >
@@ -422,7 +421,7 @@ In this next example, we attempt to have the UI adapt to the keyboard by attachi
422
421
<td ><img src =" ../assets/safearea-login-static.gif " width =" 400px " /> </td >
423
422
<td>
424
423
425
- # [ ** XAML** ] ( #tab/xaml )
424
+ ** XAML**
426
425
``` diff
427
426
<StackPanel Grid.Row="2"
428
427
x:Name="FormPanel"
@@ -450,7 +449,7 @@ In this next example, we attempt to have the UI adapt to the keyboard by attachi
450
449
Margin="0,30" />
451
450
</StackPanel>
452
451
```
453
- # [ ** C#** ] ( #tab/csharp )
452
+ ** C#**
454
453
``` diff
455
454
new StackPanel()
456
455
.Grid(row: 2)
@@ -483,7 +482,7 @@ new StackPanel()
483
482
.Margin(new Thickness(0, 30, 0, 30))
484
483
)
485
484
```
486
- ***
485
+
487
486
</td >
488
487
</tr >
489
488
</table >
@@ -524,50 +523,49 @@ There are alternative usages of `SafeArea` that may be considered in this situat
524
523
1 . Have your own ScrollViewer defined within the XAML and then you can simply wrap that ` ScrollViewer ` with any container, such as ` Grid ` , and use the ` SafeArea ` attached properties on that wrapping container.
525
524
526
525
<table >
527
- <tr >
526
+ <tr >
528
527
<th>Page</th>
529
528
<th>XAML</th>
530
- </tr >
529
+ </tr >
531
530
<tr >
532
531
<td ><img src =" ../assets/safearea-login-scroll.gif " width =" 400px " /> </td >
533
532
<td>
534
- # [ ** XAML** ] ( #tab/xaml )
535
- ``` diff
536
- <Page ...
537
- xmlns:utu="using:Uno.Toolkit.UI">
538
- + <Grid utu:SafeArea.Insets="SoftInput">
539
- + <ScrollViewer>
540
- <Grid Padding="50,0">
541
- <!-- 0: Logo, 1: Spacer, 2: FormPanel -->
542
- <Grid.RowDefinitions>
543
- <RowDefinition Height="Auto" />
544
- <RowDefinition Height="40" />
545
- <RowDefinition Height="*" />
546
- </Grid.RowDefinitions>
547
- ...
548
- + </Grid>
549
- + </ScrollViewer>
550
- </Grid>
551
- </Page>
552
- ```
553
- # [ **C#**](#tab/csharp)
554
- ```diff
555
- + new Grid()
556
- + .SafeArea(SafeArea.InsetMask.SoftInput)
557
- + .Children(
558
- + new ScrollViewer()
559
- + .Content(
560
- new Grid()
561
- .Padding(new Thickness(50,0,50,0))
562
- // 0: Logo, 1: Spacing, 2: FormPanel
563
- .RowDefinitions("Auto, 40, *")
564
- .Children(
533
+ ** XAML**
534
+ ``` diff
535
+ <Page ...
536
+ xmlns:utu="using:Uno.Toolkit.UI">
537
+ + <Grid utu:SafeArea.Insets="SoftInput">
538
+ + <ScrollViewer>
539
+ <Grid Padding="50,0">
540
+ <!-- 0: Logo, 1: Spacer, 2: FormPanel -->
541
+ <Grid.RowDefinitions>
542
+ <RowDefinition Height="Auto" />
543
+ <RowDefinition Height="40" />
544
+ <RowDefinition Height="*" />
545
+ </Grid.RowDefinitions>
546
+ ...
547
+ + </Grid>
548
+ + </ScrollViewer>
549
+ </Grid>
550
+ </Page>
551
+ ```
552
+ ** C#**
553
+ ``` diff
554
+ + new Grid()
555
+ + .SafeArea(SafeArea.InsetMask.SoftInput)
556
+ + .Children(
557
+ + new ScrollViewer()
558
+ + .Content(
559
+ new Grid()
560
+ .Padding(new Thickness(50,0,50,0))
561
+ // 0: Logo, 1: Spacing, 2: FormPanel
562
+ .RowDefinitions("Auto, 40, *")
563
+ .Children(
565
564
...
566
- )
567
- + )
568
- + )
569
- ```
570
- ***
565
+ )
566
+ + )
567
+ + )
568
+ ```
571
569
</td>
572
570
</tr>
573
571
</table>
0 commit comments