forked from Trinea/react-native-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FlexDemo.js
58 lines (52 loc) · 997 Bytes
/
FlexDemo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* React Native Demo
* https://github.com/trinea/react-native-demo
* @Trinea
*/
import React, { Component, } from 'react';
import {
StyleSheet,
Image, Text, View,
} from 'react-native';
export default class FlexDemo extends Component {
render() {
return (
<View style={styles.row}>
<Image
source={{uri: 'http://p.codekk.com/images/weixin-codekk-160.jpg'}}
style={styles.image}
/>
<View style={styles.text}>
<Text style={styles.title}>
codekk
</Text>
<Text style={styles.subtitle}>
Focus on Android
</Text>
</View>
</View>
);
}
}
var styles = StyleSheet.create({
row: {
flexDirection: 'row',
margin: 40
},
image: {
width: 120,
height: 120,
marginRight: 10
},
text: {
flex: 1,
justifyContent: 'center'
},
title: {
fontSize: 11,
fontWeight: 'bold'
},
subtitle: {
fontSize: 10
},
});