Skip to content

Commit 7c31079

Browse files
committed
fix styling to match iOS
1 parent b6827f4 commit 7c31079

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# react-native-listitem
22
iOS-style listitem component for React Native
33

4-
![listitem preview](http://i.imgur.com/ZCJoDpb.png)
4+
![listitem preview](http://i.imgur.com/mV1LFqe.gif)
55

66
## Installation
77
```
@@ -30,10 +30,10 @@ text | string | Yes | null | text displayed in listitem
3030
children | string | Yes | null | pass custom component as child
3131
backgroundColor | string | Yes | '#ffffff' |
3232
onPress | func | Yes | null | function executed onPress
33-
paddingTop | int | Yes | 14 |
34-
paddingRight | int | Yes | 16 |
35-
paddingBottom | int | Yes | 16 |
36-
paddingLeft | int | Yes | 16 |
33+
paddingTop | int | Yes | 15 |
34+
paddingRight | int | Yes | 15 |
35+
paddingBottom | int | Yes | 15 |
36+
paddingLeft | int | Yes | 0 |
3737

3838
#### Props for swipeout
3939

example/index.ios.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ var listitemExample = React.createClass({
7373
<View style={styles.container}>
7474
<ListView
7575
dataSource={this.state.dataSource}
76-
renderRow={this.renderRow} />
76+
renderRow={this.renderRow}
77+
style={styles.listview} />
7778
</View>
7879
);
7980
}
@@ -82,10 +83,14 @@ var listitemExample = React.createClass({
8283
var styles = StyleSheet.create({
8384
container: {
8485
alignItems: 'center',
85-
backgroundColor: '#f2f2f2',
86+
backgroundColor: '#efeff4',
8687
flex: 1,
8788
flexDirection: 'row',
8889
},
90+
listview: {
91+
// borderBottomColor: '#c8c7cc',
92+
// borderBottomWidth: 1,
93+
}
8994
});
9095

9196
AppRegistry.registerComponent('listitemExample', () => listitemExample);

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ var Listitem = React.createClass({
1010
return {
1111
backgroundColor: '#ffffff',
1212
onPress: null,
13-
paddingTop: 14,
14-
paddingRight: 16,
15-
paddingBottom: 16,
16-
paddingLeft: 16,
13+
paddingTop: 15,
14+
paddingRight: 15,
15+
paddingBottom: 15,
16+
paddingLeft: 0,
1717
text: null,
1818
underlayColor: "rgba(0,0,0,.015)",
1919
}

styles.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ var {StyleSheet} = React
33

44
var styles = StyleSheet.create({
55
li: {
6-
borderBottomColor: '#eee',
7-
borderColor: 'transparent',
8-
borderWidth: 1,
6+
borderBottomColor: '#c8c7cc',
7+
borderBottomWidth: 0.5,
98
},
109
liContainer: {
1110
flex: 1,
11+
paddingLeft: 15,
1212
},
1313
liText: {
1414
color: '#333',
15-
fontSize: 16,
16-
fontWeight: '400'
15+
fontSize: 17,
16+
fontWeight: '400',
17+
marginBottom: -3.5,
18+
marginTop: -3.5,
1719
},
1820
})
1921

0 commit comments

Comments
 (0)