You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,9 @@
20
20
21
21
The goal of the safe area container is to provide a custom control to simplify handling safe areas with UI Toolkit on relevant devices.
22
22
23
-
- Optional safe area and margin collapse.
23
+
- Option to collapse margins with the safe area.
24
+
- Option to exclude specific safe area edges.
25
+
- Option to exclude safe area on tvOS.
24
26
25
27
## Usage
26
28
@@ -30,19 +32,31 @@ The SafeArea container is available in the Library in UI Builder and can be foun
30
32
31
33
The SafeArea container should be added as the top element in the hierarchy to ensure that it can fill up the entire screen. All child elements dropped into the SafeArea container will live inside `safe-area-content-container` and be adjusted accordingly depending on the current device SafeArea.
32
34
33
-
Margins can be set on the SafeArea container, useful when running on devices that does not utilize a safe area.
35
+
Margins can be set on the SafeArea container, which can be useful when running on devices that does not utilize a safe area.
34
36
35
-
The container margins and the safe area is collapsed by default. That can be disabled in the inspector.
37
+
The SafeArea container has a selection of custom attributes that can be set in the UI Builder inspector.
The container margins and the safe area is collapsed by default. That can be disabled in the inspector.
44
+
39
45
Take a look at these screenshots which helps illustrate the differences how margin, safe area and collapse comes together. In each example the margin is set to `10px 10px 0px 10px`.
1. For a device without a safe area, the margin values are used as-is and collapse margins doesn't play a part as there is no safe area to collapse with.
44
50
2. For a device with a safe area the margins are collapsed with the safe area. The margin value is used if it would be larger than the safe area.
45
-
3. If `Collapse Margin` is disabled, the margin is added to the safe area.
51
+
3. If `Collapse Margins` is disabled, the margin is added to the safe area.
52
+
53
+
### Exclude Edges
54
+
55
+
With exclude edges, the safe area value of `left`, `right`, `top` and `bottom` edges can optionally be excluded from the calculations. If an edge is excluded, only the margin value for that edge will be used.
56
+
57
+
### Exclude tvOS
58
+
59
+
This option excludes the safe area values for all edges on tvOS. If selected, tvOS builds will not use safe area but only the margin values.
0 commit comments