ProgressBarAndroid#progress

progress number The progress value (between 0 and 1).

ProgressBarAndroid#color

color color Color of the progress bar.

ProgressBarAndroid#indeterminate

indeterminate indeterminateType If the progress bar will show indeterminate progress. Note that this can only be false if styleAttr is Horizontal.

ProgressBarAndroid#styleAttr

styleAttr STYLE_ATTRIBUTES Style of the ProgressBar. One of: Horizontal Normal (default) Small Large Inverse SmallInverse LargeInverse

Platform Specific Code

When building a cross-platform app, the need to write different code for different platforms may arise. This can always be achieved by organizing the various components in different folders: /common/components/ /android/components/ /ios/components/ Another option may be naming the components differently depending on the platform they are going to be used in: BigButtonIOS.js BigButtonAndroid.js But React Native provides two alternatives to easily organize your code separating it by platform: Pl

Profiling Android UI Performance

We try our best to deliver buttery-smooth UI performance by default, but sometimes that just isn't possible. Remember, Android supports 10k+ different phones and is generalized to support software rendering: the framework architecture and need to generalize across many hardware targets unfortunately means you get less for free relative to iOS. But sometimes, there are things you can improve (and many times it's not native code's fault at all!). The first step for debugging this jank is to answe

PixelRatio.getPixelSizeForLayoutSize()

static getPixelSizeForLayoutSize(layoutSize) Converts a layout size (dp) to pixel size (px). Guaranteed to return an integer number.

PixelRatio.startDetecting()

static startDetecting() // No-op for iOS, but used on the web. Should not be documented.

PixelRatio.roundToNearestPixel()

static roundToNearestPixel(layoutSize) Rounds a layout size (dp) to the nearest layout size that corresponds to an integer number of pixels. For example, on a device with a PixelRatio of 3, PixelRatio.roundToNearestPixel(8.4) = 8.33, which corresponds to exactly (8.33 * 3) = 25 pixels.

PixelRatio.get()

static get() Returns the device pixel density. Some examples: PixelRatio.get() === 1mdpi Android devices (160 dpi) PixelRatio.get() === 1.5hdpi Android devices (240 dpi) PixelRatio.get() === 2iPhone 4, 4S iPhone 5, 5c, 5s iPhone 6 xhdpi Android devices (320 dpi) PixelRatio.get() === 3iPhone 6 plus xxhdpi Android devices (480 dpi) PixelRatio.get() === 3.5Nexus 6