React Native Common Component Styles Summary

Source: Internet
Author: User
Tags border color

As a JS, CSS, RN Novice, will always encounter a variety of styles. It is difficult to draw a layout well without knowing what the style is. So here are a few of the most common layout styles.

View Style

Supports Flexbox, Shadowproptypesios, transforms properties.

Back visibility

backfaceVisibility enum(‘visible‘, ‘hidden‘)

Background color

backgroundColor string

Border color

borderColor stringborderTopColor stringborderRightColor stringborderBottomColor stringborderLeftColor string

Border Fillet radius

borderRadius numberborderTopLeftRadius numberborderTopRightRadius numberborderBottomLeftRadius numberborderBottomRightRadius number

Border Style

borderStyle enum(‘solid‘, ‘dotted‘, ‘dashed‘)

Border width

borderWidth numberborderTopWidth numberborderRightWidth numberborderBottomWidth numberborderLeftWidth number

Opacity

opacity number

Fill

overflow enum(‘visible‘, ‘hidden‘)

Test ID (used to locate the view)

testID string
Image Style

Supports Flexbox and transforms

Sizing mode

resizeMode Object.keys(ImageResizeMode)

Background color

backgroundColor string

Border properties

borderColor stringborderWidth numberborderRadius number

Fill

overflow enum(‘visible‘, ‘hidden‘)

Color colors

tintColor string

Opacity

opacity number
Text Style

Styles that support view

Font Color

color string

Font

fontFamily string

Font size

fontSize number

Font style

fontStyle enum(‘normal‘, ‘italic‘)

Font weight (Specifies the weight of the font.) Most fonts support the ' normal ' and ' bold ' values. Not all fonts support all numeric values. If a value is not supported, the closest value is automatically selected. )

fontWeight enum("normal", ‘bold‘, ‘100‘, ‘200‘, ‘300‘, ‘400‘, ‘500‘, ‘600‘, ‘700‘, ‘800‘, ‘900‘)

Word spacing

letterSpacing number

Line spacing

lineHeight number

Font Alignment (specifies how text is aligned.) Where the ' justify ' value is only supported by iOS. )

textAlign enum("auto", ‘left‘, ‘right‘, ‘center‘, ‘justify‘)
Flexbox Style

Wide Height

width numberheight number

Project Alignment

alignItems enum(‘flex-start‘, ‘flex-end‘, ‘center‘, ‘stretch‘)

Self-aligning

alignSelf enum(‘auto‘, ‘flex-start‘, ‘flex-end‘, ‘center‘, ‘stretch‘)

Border width

borderBottomWidth numberborderLeftWidth numberborderRightWidth numberborderTopWidth numberborderWidth number

Elastic Scaling

flex number

Elastic Telescopic Direction

flexDirection enum(‘row‘, ‘column‘)

Elastic Telescopic Package

flexWrap enum(‘wrap‘, ‘nowrap‘)

Proof content

justifyContent enum(‘flex-start‘, ‘flex-end‘, ‘center‘, ‘space-between‘, ‘space-around‘)

Outer margin

margin numbermarginBottom numbermarginLeft numbermarginRight numbermarginTop numbermarginHorizontal numbermarginVertical number

Inner margin

padding numberpaddingBottom numberpaddingLeft numberpaddingRight numberpaddingTop numberpaddingHorizontal numberpaddingVertical number

Position (absolute, relative)

position enum(‘absolute‘, ‘relative‘)

Up or down

right numbertop numberleft numberbottom number
Transform

Property changes

Attribute matrix

Resources

React native Chinese web

React Native Common Component Styles Summary

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.