Official Content

Configures the shadows cast by controls.

Scope

Generators: Android, Apple
Level: Design System Style Class

Description

This property is available in Native Mobile applications for these controls: Attribute/Variable, Button, Grid, Group, Image, Tab, Table, Text Block.

It accepts positive numerical values to indicate how much shadow to show.
By default, its value is empty (semantically, it represents 0).

Runtime/Design time

This property applies both at runtime and at design time.

Samples

The example below is based on customized buttons.

First, in your Design System object define the following in the .Button class created to give style to your buttons:

.Button
        {
           border-style: solid;
           border-color: 14BBCC;
           border-width: 1dip;
           border-radius: 60dip;
           background-color: 14BBCC;
           gx-elevation: 20;
         }

In this case the gx-elevation value chosen is 20.

Next, after dragging the Button Control from the Toolbox to an Abstract Layout of a Panel or Work With, set the following:

Width = 40 
Height = 40
Image = <an_add_to_cart_icon>
Class = <class_previously_created> 

With this configuration, the button will have a rounded look with a small icon inside it.

Finally, after defining the Elevation property, the effects achieved are shown in the following table:

  Value by default 5 10 20
  Effect Elevation0_png Elevation5_png Elevation10_png Elevation20_png

Notes:

  • This property is available for Android 5.0 or higher.
  • To see the effect, the background color should be opaque.
  • The space for the control and its shadow must be smaller than its container cell. 
  • If there are controls inside a Canvas with Elevation and ZOrder properties set, the difference between two controls with the same ZOrder is their Elevation.
  • To change the elevation at runtime, change the Design System Class. For instance, if you have set the Button class for a button control, you can type:
    Button1.Class = StyleClass:ButtonWithElevation
    
    where ButtonWithElevation is a Design System Class with its Elevation property set.

Availability

This property is available since GeneXus 17 Upgrade 6.

See Also

HowTo: Adding Material Design to Android applications
Design System Object
Grid control
 

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant