ProgressBarAndroid

React 组建包裹了只是 Android 部分的 ProgressBar。这个组件是被用来提示这个应用正在加载或者在应用里面有一些操作。

例子:

  1. render: function() {
  2. var progressBar =
  3. <View style={styles.container}>
  4. <ProgressBar styleAttr="Inverse" />
  5. </View>;
  6. return (
  7. <MyLoadingComponent
  8. componentView={componentView}
  9. loadingView={progressBar}
  10. style={styles.loadingComponent}
  11. />
  12. );
  13. },

属性

styleAttr 样式属性

进度条的样式,包括:

  • Horizontal
  • Small
  • Large
  • Inverse
  • SmallInverse
  • LargeInverse

testID 字符串
在端对端测试里面被用来定位这个视图。

例子

  1. 'use strict';
  2. var ProgressBar = require('ProgressBarAndroid');
  3. var React = require('React');
  4. var UIExplorerBlock = require('UIExplorerBlock');
  5. var UIExplorerPage = require('UIExplorerPage');
  6. var ProgressBarAndroidExample = React.createClass({
  7. statics: {
  8. title: '<ProgressBarAndroid>',
  9. description: 'Visual indicator of progress of some operation. ' +
  10. 'Shows either a cyclic animation or a horizontal bar.',
  11. },
  12. render: function() {
  13. return (
  14. <UIExplorerPage title="ProgressBar Examples">
  15. <UIExplorerBlock title="Default ProgressBar">
  16. <ProgressBar />
  17. </UIExplorerBlock>
  18. <UIExplorerBlock title="Small ProgressBar">
  19. <ProgressBar styleAttr="Small" />
  20. </UIExplorerBlock>
  21. <UIExplorerBlock title="Large ProgressBar">
  22. <ProgressBar styleAttr="Large" />
  23. </UIExplorerBlock>
  24. <UIExplorerBlock title="Inverse ProgressBar">
  25. <ProgressBar styleAttr="Inverse" />
  26. </UIExplorerBlock>
  27. <UIExplorerBlock title="Small Inverse ProgressBar">
  28. <ProgressBar styleAttr="SmallInverse" />
  29. </UIExplorerBlock>
  30. <UIExplorerBlock title="Large Inverse ProgressBar">
  31. <ProgressBar styleAttr="LargeInverse" />
  32. </UIExplorerBlock>
  33. </UIExplorerPage>
  34. );
  35. },
  36. });
  37. module.exports = ProgressBarAndroidExample;