首页 > 其他 > 详细

PixelRatio使用

时间:2018-12-28 14:26:43      阅读:174      评论:0      收藏:0      [点我收藏+]
export default class PixelRatioView extends Component {


    render() {
        return (
            <View style={styles.container}>
                <Text style={styles.textStyle}>
                    PixelRatio实例
                </Text>
                <Text style={styles.textStyle}>
                    当前的屏幕像素密度比例为: {PixelRatio.get()}
                </Text>
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: ‘#ffffff‘,
        marginTop: 20
    },
    textStyle: {
        fontSize: 18,
        textAlign: ‘center‘,
        backgroundColor: ‘#ffffff‘,
        marginTop: 10
    }

});

 

PixelRatio使用

原文:https://www.cnblogs.com/hualuoshuijia/p/10190290.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!