change examples layout

This commit is contained in:
Horcrux
2016-06-09 21:15:59 +08:00
parent 1bbcb73052
commit 26cc3d4dd9

View File

@@ -4,6 +4,7 @@
*/ */
'use strict'; 'use strict';
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Dimensions} from 'react-native';
import { import {
AppRegistry, AppRegistry,
@@ -42,7 +43,10 @@ const styles = StyleSheet.create({
borderTopWidth: hairline, borderTopWidth: hairline,
borderTopColor: '#ccc', borderTopColor: '#ccc',
borderBottomWidth: hairline, borderBottomWidth: hairline,
borderBottomColor: '#ccc' borderBottomColor: '#ccc',
flexWrap: 'wrap',
flexDirection: 'row',
marginHorizontal: 10
}, },
welcome: { welcome: {
padding: 10, padding: 10,
@@ -51,14 +55,14 @@ const styles = StyleSheet.create({
fontWeight: 'bold' fontWeight: 'bold'
}, },
link: { link: {
marginHorizontal: 10, alignSelf: 'stretch',
alignSelf: 'stretch' width: Dimensions.get('window').width / 2 - 10
}, },
title: { title: {
marginLeft: 10 marginLeft: 10
}, },
cell: { cell: {
height: 30, height: 40,
paddingHorizontal: 10, paddingHorizontal: 10,
alignSelf: 'stretch', alignSelf: 'stretch',
alignItems: 'center', alignItems: 'center',
@@ -241,12 +245,11 @@ class SvgExample extends Component {
<Text style={styles.welcome}> <Text style={styles.welcome}>
SVG library for React Native SVG library for React Native
</Text> </Text>
<ScrollView <View
style={styles.content} style={styles.contentContainer}
contentContainerStyle={styles.contentContainer}
> >
{this.getExamples()} {this.getExamples()}
</ScrollView> </View>
</View>; </View>;
} }
} }