Authored by 孙凯

适配 iPhoneXreview by hongmo

@@ -21,6 +21,7 @@ import Comments from './Comments'; @@ -21,6 +21,7 @@ import Comments from './Comments';
21 import CommentsTitle from './CommentsTitle'; 21 import CommentsTitle from './CommentsTitle';
22 import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator'; 22 import LoadMoreIndicator from '../../../common/components/LoadMoreIndicator';
23 import YH_Video from '../../../common/components/YH_Video'; 23 import YH_Video from '../../../common/components/YH_Video';
  24 +import DeviceInfo from 'react-native-device-info';
24 25
25 import ReactNative, { 26 import ReactNative, {
26 View, 27 View,
@@ -83,6 +84,11 @@ export default class Detail extends Component { @@ -83,6 +84,11 @@ export default class Detail extends Component {
83 _keyboardWillShow(e){ 84 _keyboardWillShow(e){
84 let endH = e.endCoordinates.height; 85 let endH = e.endCoordinates.height;
85 let duration = e.duration; 86 let duration = e.duration;
  87 + if (deviceId == 'iPhone10,3' || deviceId == 'iPhone10,6')
  88 + {
  89 + endH = endH - 34;
  90 + }
  91 +
86 Animated.timing( 92 Animated.timing(
87     this.state.viewMarginTop, 93     this.state.viewMarginTop,
88     { 94     {
@@ -274,7 +280,7 @@ export default class Detail extends Component { @@ -274,7 +280,7 @@ export default class Detail extends Component {
274 280
275 return ( 281 return (
276 <View style={styles.container}> 282 <View style={styles.container}>
277 - {!isFetching?<Animated.View style={{width: width,height: height - 64,marginTop:this.state.viewMarginTop}}> 283 + {!isFetching?<Animated.View style={{flex: 1,top:this.state.viewMarginTop}}>
278 <ListView 284 <ListView
279 ref={(ref)=>this.listView=ref} 285 ref={(ref)=>this.listView=ref}
280 initialListSize={1} 286 initialListSize={1}
@@ -336,12 +342,11 @@ export default class Detail extends Component { @@ -336,12 +342,11 @@ export default class Detail extends Component {
336 } 342 }
337 343
338 let {width, height} = Dimensions.get('window'); 344 let {width, height} = Dimensions.get('window');
  345 +let deviceId = DeviceInfo.getDeviceId();
339 346
340 let styles = StyleSheet.create({ 347 let styles = StyleSheet.create({
341 container: { 348 container: {
342 flex: 1, 349 flex: 1,
343 - width: width,  
344 - height: height - 64,  
345 }, 350 },
346 contentContainer:{ 351 contentContainer:{
347 backgroundColor: 'white', 352 backgroundColor: 'white',