美文网首页
RN常用组件

RN常用组件

作者: 菠萝鱼_lc | 来源:发表于2017-10-17 11:25 被阅读0次

Button:

Image在布局中的使用:
如果设置从网络获取图片,需要设置图片大小,否则显示不出来。

            <View style={{flex: 1, flexDirection: 'row'}}>
                <Image source={{uri: 'http://app.fengjr.com/public/dist/apk/res/img/finachan-1473762800726.png'}}
                       style={{width: 50, height: 50}} />
                <View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
                <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
            </View>

Toast:

        ToastAndroid.show('This is a toast with short duration', ToastAndroid.SHORT)

AppRegistry:

AppRegistry.registerComponent('MyReactNativeApp', () => HelloWorldApp);

参数1:一般都为package里面的key
参数2:是你要注入的Component的

相关文章

网友评论

      本文标题:RN常用组件

      本文链接:https://www.haomeiwen.com/subject/rkoruxtx.html