Skip to content

Commit ffddea2

Browse files
committed
elevation examples
1 parent 3613b79 commit ffddea2

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docs/ui/styling.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,47 @@ In the context of mobile development, there are a number of properties that are
596596
| `android-selected-tab-highlight-color` | `androidSelectedTabHighlightColor` | **Android** | `TabView` | Sets the underline color of the tabs in Android. |
597597
| `android-elevation` | `androidElevation` | **Android** | `View` | Sets the elevation of the View in Android. |
598598
599+
### Using the androidElevation property <sub>Android</sub>
600+
601+
Since {N} 5.4, a new Android-specific property, called `androidElevation`, is introduced. View's elevation is represented by Zproperty and determines the visual appearance of its shadow. With higher elevation value larger, softer shadows will be set to the View and smaller shadow while using lower elevation.
602+
603+
Example:
604+
{% nativescript %}
605+
```CSS
606+
.tvElevation{
607+
android-elevation:5;
608+
}
609+
```
610+
```XML
611+
<StackLayout class="home-panel">
612+
<TextView class="tvElevation" editable="false" textWrap="true" text="TextView" />
613+
<Label androidElevation="5" class="sampleLabel" textWrap="true" text="Label" />
614+
<Button androidElevation="7" class="sampleButton" text="Button" />
615+
</StackLayout>
616+
```
617+
618+
[Demo](https://play.nativescript.org/?template=play-tsc&id=ZraiEJ)
619+
{% endnativescript %}
620+
{% angular %}
621+
```CSS
622+
.tvElevation{
623+
android-elevation:5;
624+
}
625+
```
626+
```XML
627+
<StackLayout class="home-panel">
628+
<TextView class="tvElevation" editable="false" textWrap="true" text="TextView" ></TextView>
629+
<Label androidElevation="5" class="sampleLabel" textWrap="true" text="Label" ></Label>
630+
<Button androidElevation="7" class="sampleButton" text="Button" ></Button>
631+
</StackLayout>
632+
```
633+
634+
[Demo](https://play.nativescript.org/?template=play-ng&id=hfogBI)
635+
{% endangular %}
636+
637+
More info about this property can be found in [Create Shadows and Clip Views](https://developer.android.com/training/material/shadows-clipping) article.
638+
639+
599640
## Supported Measurement Units
600641
601642
NativeScript supports **DIPs** (Device Independent Pixels), **pixels** (via postfix `px`) and **percentages** (partial support for `width`, `height` and `margin`) as measurement units.

0 commit comments

Comments
 (0)