![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react-native
react-native开发中的一些笔记
秋刀鱼笛滋味
这个作者很懒,什么都没留下…
展开
-
react-native Text上下居中 一像素问题
1,Text 组件设置lineHight=hight, textAlignVertical:'center',一些安卓设备上还是不能上下居中 hock: <View style={{ justifyContent: "center",alignItems: "center",}}> <Text>122</Text> </V...原创 2019-11-14 14:36:40 · 520 阅读 · 0 评论 -
react-navigation 常用方法总结
1,创建底部选项卡 createBottomTabNavigator import React from "react"; import { StyleSheet, Image } from "react-native"; import {setSpText, scaleSizeW} from '../utils/util'; import Home from '../page/home/home...原创 2019-11-14 14:23:31 · 508 阅读 · 0 评论 -
react-native 封装一个可以滑动的步骤条 Step
可以根据prop (step)滑动 到指定位置,可以左右滑动 import React, { Component } from "react"; import { Text, View, StyleSheet, ScrollView, TouchableOpacity } from "react-native"; import { scaleSizeW, setSpText...原创 2019-11-14 11:44:38 · 1117 阅读 · 0 评论 -
react-native 底部弹窗选项卡 + 上传图片 +预览图片
效果图, 支持默认图片,上传中的状态,最大上传数量,预览大图等功能 import React, { Component } from "react"; import { StyleSheet, View, Text, Image, TouchableOpacity, Modal, Platform } from "react-native"; import { sca...原创 2019-11-14 11:37:26 · 674 阅读 · 0 评论 -
react-native Toast简单封装
import {Component} from 'react'; import Toast from 'react-native-tiny-toast'; import {setSpText} from './util'; export default class ToastBox extends Component { static show = content => { /...原创 2019-11-14 11:17:32 · 909 阅读 · 0 评论 -
react-native AsyncStorage 封装
AsyncStorage 类似localStorage ,不过是异步的 返回Promise /** * AsyncStorage是一个简单的、异步的、持久化的Key-Value存储系统, */ import {AsyncStorage} from 'react-native'; class StorageUtil { /** * 根据key获取json数值 * @param ...原创 2019-11-14 11:11:16 · 566 阅读 · 0 评论 -
react-native 自适应
import { Dimensions, PixelRatio, Platform, StatusBar } from 'react-native'; import ImagePicker from 'react-native-image-crop-picker'; const { width, height } = Dimensions.get('window'); import { getI...原创 2019-11-14 11:02:48 · 473 阅读 · 0 评论