mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-18 12:22:20 +08:00
Activity indicator: add size prop
Summary: **motivation** Previously, size can only accept either 'small' or 'large'. And to obtain a custom size, scale transformation is used. This is to let users to possibly pass number value directly to define ActivityIndicator's size. **Test plan** I have also modified the current example to reflect the new size prop in action. Closes https://github.com/facebook/react-native/pull/8935 Differential Revision: D3637910 fbshipit-source-id: 6b8e1d4504964916df327b2d3eaaef1bb8cd5112
This commit is contained in:
committed by
Facebook Github Bot 5
parent
873c6ff5b9
commit
63d15af18d
@@ -113,8 +113,8 @@ exports.examples = [
|
||||
return (
|
||||
<ActivityIndicator
|
||||
style={[styles.centering, styles.gray]}
|
||||
color="white"
|
||||
size="large"
|
||||
color="white"
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -161,8 +161,21 @@ exports.examples = [
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
platform: 'android',
|
||||
title: 'Custom size (size: 75)',
|
||||
render() {
|
||||
return (
|
||||
<ActivityIndicator
|
||||
style={styles.centering}
|
||||
size={75}
|
||||
/>
|
||||
);
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
centering: {
|
||||
alignItems: 'center',
|
||||
|
||||
Reference in New Issue
Block a user