调整了相关资讯的样式。review by shixiang。
Showing
1 changed file
with
21 additions
and
19 deletions
@@ -35,7 +35,9 @@ export default class BrandArticleList extends Component { | @@ -35,7 +35,9 @@ export default class BrandArticleList extends Component { | ||
35 | 35 | ||
36 | _renderHeader(){ | 36 | _renderHeader(){ |
37 | return( | 37 | return( |
38 | + <View style={styles.headerContainer}> | ||
38 | <Text style={styles.headerText}>相关资讯</Text> | 39 | <Text style={styles.headerText}>相关资讯</Text> |
40 | + </View> | ||
39 | ); | 41 | ); |
40 | } | 42 | } |
41 | 43 | ||
@@ -43,7 +45,6 @@ export default class BrandArticleList extends Component { | @@ -43,7 +45,6 @@ export default class BrandArticleList extends Component { | ||
43 | 45 | ||
44 | return ( | 46 | return ( |
45 | <BrandArticleCell | 47 | <BrandArticleCell |
46 | - // style={[styles.listContainer, customStyle]} | ||
47 | key={'row' + rowID} | 48 | key={'row' + rowID} |
48 | rowID={rowID} | 49 | rowID={rowID} |
49 | rowData={rowData} | 50 | rowData={rowData} |
@@ -74,7 +75,7 @@ export default class BrandArticleList extends Component { | @@ -74,7 +75,7 @@ export default class BrandArticleList extends Component { | ||
74 | renderSeparator={this._renderSeparator} | 75 | renderSeparator={this._renderSeparator} |
75 | onPressArticle={this.props.onPressArticle} | 76 | onPressArticle={this.props.onPressArticle} |
76 | onPressArticleLike={this.props.onPressArticleLike} | 77 | onPressArticleLike={this.props.onPressArticleLike} |
77 | - //renderHeader={this._renderHeader} | 78 | + renderHeader={this._renderHeader} |
78 | /> | 79 | /> |
79 | 80 | ||
80 | </View> | 81 | </View> |
@@ -83,41 +84,42 @@ export default class BrandArticleList extends Component { | @@ -83,41 +84,42 @@ export default class BrandArticleList extends Component { | ||
83 | } | 84 | } |
84 | 85 | ||
85 | let {width, height} = Dimensions.get('window'); | 86 | let {width, height} = Dimensions.get('window'); |
86 | -let rowWidth = Math.ceil(137.5 * width / 320); | ||
87 | -let rowHeight = Math.ceil(254 * width / 320); | ||
88 | -let rowMarginTop = Math.ceil(10 * width / 320); | 87 | +const DEVICE_WIDTH_RATIO = width / 320; |
89 | 88 | ||
90 | let styles = StyleSheet.create({ | 89 | let styles = StyleSheet.create({ |
91 | container: { | 90 | container: { |
92 | flex: 1, | 91 | flex: 1, |
93 | - backgroundColor: 'white', | ||
94 | }, | 92 | }, |
95 | contentContainer: { | 93 | contentContainer: { |
96 | flexWrap: 'wrap', | 94 | flexWrap: 'wrap', |
97 | }, | 95 | }, |
98 | - filterContainer: { | ||
99 | 96 | ||
100 | - }, | ||
101 | - listContainer: { | ||
102 | - width: width / 2, | ||
103 | - }, | ||
104 | separator: { | 97 | separator: { |
105 | width, | 98 | width, |
106 | height: 20, | 99 | height: 20, |
107 | backgroundColor: '#e0e0e0', | 100 | backgroundColor: '#e0e0e0', |
108 | }, | 101 | }, |
109 | 102 | ||
110 | - headerText:{ | ||
111 | - width, | ||
112 | - marginLeft: 29, | ||
113 | - marginRight: 29, | 103 | + headerContainer:{ |
104 | + height: 36 * DEVICE_WIDTH_RATIO, | ||
105 | + marginLeft: 30 * DEVICE_WIDTH_RATIO, | ||
106 | + marginRight: 30 * DEVICE_WIDTH_RATIO, | ||
107 | + justifyContent: 'center', | ||
108 | + alignItems: 'center', | ||
114 | borderColor: '#e0e0e0', | 109 | borderColor: '#e0e0e0', |
110 | + borderTopWidth: 0.5, | ||
111 | + borderLeftWidth: 0.5, | ||
112 | + borderRightWidth: 0.5, | ||
115 | borderBottomWidth: 0, | 113 | borderBottomWidth: 0, |
116 | - lineHeight: 36, | ||
117 | - fontSize: 30, | 114 | + backgroundColor: "#ffffff", |
115 | + }, | ||
116 | + headerText:{ | ||
117 | + // width: 'wrap', | ||
118 | + // height: 'wrap', | ||
119 | + lineHeight: 18, | ||
120 | + fontSize: 16, | ||
118 | color: '#b0b0b0', | 121 | color: '#b0b0b0', |
119 | - alignItems: 'center', | ||
120 | justifyContent: 'center', | 122 | justifyContent: 'center', |
121 | - backgroundColor: "#ffffff", | 123 | + alignItems: 'center', |
122 | }, | 124 | }, |
123 | }); | 125 | }); |
-
Please register or login to post a comment