Notice: 函数 WP_Scripts::localize 的调用方法不正确$l10n 参数必须是一个数组。若要将任意数据传递给脚本,请改用 wp_add_inline_script() 函数。 请查阅调试 WordPress来获取更多信息。 (这个消息是在 5.7.0 版本添加的。) in /data/www/appblog/wp-includes/functions.php on line 6131

React Native学习之ProgressBar组件

分平台的:ProgressBarAndroidProgressViewIOS

ProgressBar组件的属性:

  • styleAttr:进度条的样式,Horizontal Small Large Inverse SmallInverse LargeInverse
  • progress:当前的进度值(在0到1之间)

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 */
'use strict';

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    PixelRatio,
    Text,
    Image,
    TouchableOpacity,
    ProgressBarAndroid,
    View
} from 'react-native';

class RNAPP extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <View style={[styles.flex, {marginTop:45}]}>
                <Text>ProgressBar组件</Text>

                <ProgressBarAndroid styleAttr="Horizontal" />
            </View>
        );
    }
}

const styles = StyleSheet.create({
    flex:{
        flex:1,
    },
});

AppRegistry.registerComponent('RNAPP', () => RNAPP);
上一篇 JavaScript实现HmacSHA256摘要
下一篇 React Native学习之DrawerLayoutAndroid组件