Native UI Controls
Supported Views
- LinearLayout
- FrameLayout
- RelativeLayout
- ScrollView
- HorizontalScrollView
- View
- Button
- TextView
- EditText
- CheckBox
- RadioGroup
- RadioButton
- Spinner
- WebView
- ImageView
- CardView
- Switch
- FlexboxLayout
- include tag
- Canvas
Common Properties
| Property | Description | Values |
|---|---|---|
| layout_width | Width | wrap_content: match content size match_parent: match parent size specific number + dp |
| layout_height | Height | wrap_content: match content size match_parent: match parent size specific number + dp |
| background | Background color | Hex color, e.g. #FFFFFF or #FFFFFFFF |
| tag | Tag | Chinese or English; retrieve the corresponding value by tag in code |
| visibility | Visibility | gone: hidden visible: shown invisible: hidden but occupies space |
| clickable | Clickable | true: clickable false: not clickable |
| enable | Enabled | true: enabled false: disabled |
| minHeight | Minimum height | specific number + dp |
| minWidth | Minimum width | specific number + dp |
| paddingLeft | Left padding | specific number + dp |
| paddingTop | Top padding | specific number + dp |
| paddingRight | Right padding | specific number + dp |
| paddingBottom | Bottom padding | specific number + dp |
| padding | Padding on all sides | specific number + dp |
| layout_gravity | Alignment within parent container | Usage reference top bottom left right center_vertical fill_vertical center_horizontal fill_horizontal center fill clip_vertical clip_horizontal |
| layout_margin | Margin on all sides | specific number + dp |
| layout_marginLeft | Left margin | specific number + dp |
| layout_marginRight | Right margin | specific number + dp |
| layout_marginTop | Top margin | specific number + dp |
| layout_marginBottom | Bottom margin | specific number + dp |
| cornerRadius | View corner radius | specific number + dp |
UI Height and Width
- Properties:
layout_width,layout_height match_parent— fill the parent containerwrap_content— size based on actual content width- Numeric values, e.g.
12dp, represent 12 dp units (dpis Android's density-independent pixel unit)