ProgressBarAndroid#styleAttr

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

ProgressBarAndroid#progress

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

ProgressBarAndroid#indeterminate

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

ProgressBarAndroid#color

color color Color of the progress bar.

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

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

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.getPixelSizeForLayoutSize()

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

PixelRatio.getFontScale()

static getFontScale() Returns the scaling factor for font sizes. This is the ratio that is used to calculate the absolute font size, so any elements that heavily depend on that should use this to do calculations. If a font scale is not set, this returns the device pixel ratio. Currently this is only implemented on Android and reflects the user preference set in Settings > Display > Font size, on iOS it will always return the default pixel ratio. @platform android