Categories: React Native 教程

React Native:ProgressBarAndroid

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

例子:

render: function() {  var progressBar =    <View style={styles.container}>
      <ProgressBar styleAttr="Inverse" />
    </View>;

  return (    <MyLoadingComponent
      componentView={componentView}
      loadingView={progressBar}
      style={styles.loadingComponent}
    />
  );
},

属性

styleAttr 样式属性

进度条的样式,包括:

  • Horizontal

  • Small

  • Large

  • Inverse

  • SmallInverse

  • LargeInverse

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

例子

use strict;var ProgressBar = require(ProgressBarAndroid);var React = require(React);var UIExplorerBlock = require(UIExplorerBlock);var UIExplorerPage = require(UIExplorerPage);var ProgressBarAndroidExample = React.createClass({

  statics: {
    title: <ProgressBarAndroid>,
    description: Visual indicator of progress of some operation.  +        Shows either a cyclic animation or a horizontal bar.,
  },

  render: function() {    return (      <UIExplorerPage title="ProgressBar Examples">
        <UIExplorerBlock title="Default ProgressBar">
          <ProgressBar />
        </UIExplorerBlock>

        <UIExplorerBlock title="Small ProgressBar">
          <ProgressBar styleAttr="Small" />
        </UIExplorerBlock>

        <UIExplorerBlock title="Large ProgressBar">
          <ProgressBar styleAttr="Large" />
        </UIExplorerBlock>

        <UIExplorerBlock title="Inverse ProgressBar">
          <ProgressBar styleAttr="Inverse" />
        </UIExplorerBlock>

        <UIExplorerBlock title="Small Inverse ProgressBar">
          <ProgressBar styleAttr="SmallInverse" />
        </UIExplorerBlock>

        <UIExplorerBlock title="Large Inverse ProgressBar">
          <ProgressBar styleAttr="LargeInverse" />
        </UIExplorerBlock>
      </UIExplorerPage>
    );
  },
});module.exports = ProgressBarAndroidExample;

terry

这个人很懒,什么都没有留下~

Share
Published by
terry

Recent Posts

聊聊vue3中的defineProps

在Vue 3中,defineP…

1 周 ago

在 Chrome 中删除、允许和管理 Cookie

您可以选择删除现有 Cooki…

2 周 ago

自定义指令:聊聊vue中的自定义指令应用法则

今天我们来聊聊vue中的自定义…

3 周 ago

聊聊Vue中@click.stop和@click.prevent

一起来学下聊聊Vue中@cli…

4 周 ago

Nginx 基本操作:启动、停止、重启命令。

我们来学习Nginx基础操作:…

4 周 ago

Vue3:手动清理keep-alive组件缓存的方法

Vue3中手动清理keep-a…

1 月 ago