演示图
安装
$ npm install react-native-steam-card --save
或
$ yarn add react-native-steam-card
项目地址
使用实例
import React from 'react';
import type {Node} from 'react';
import { StyleSheet, View } from 'react-native';
import SteamCard from 'react-native-steam-card';
// TODO: What to do with the module?
const App: () => Node = () => {
return (
<View style={styles.container}>
<SteamCard
source={require("./asset/island.png")}
ratio={0.65}
/>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
borderColor: 'rgba(23,41,48,1)',
},
});
export default App;
属性设置
属性 | 默认值 | 说明 |
---|---|---|
source | 必填 | 图片路径 |
ratio | 0.8 | 图片在视图内的缩放比例 |
style | - | 图片样式 |