Skip to content

Commit

Permalink
Take in account the SafeView in iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioEstevao committed Aug 1, 2018
1 parent ef54b8b commit d569a61
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions example/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import {AppRegistry, StyleSheet, View, FlatList, KeyboardAvoidingView} from 'react-native';
import {AppRegistry, StyleSheet, View, FlatList, KeyboardAvoidingView, SafeAreaView, Platform} from 'react-native';
import {example_content} from './content';
import RCTAztecView from 'react-native-aztec'

Expand All @@ -11,11 +11,11 @@ export default class example extends React.Component {
this.state = {isShowingText: true, height: _minHeight, text: example_content()};
console.log("a ver que tiene" + JSON.stringify(this.state));
}

render() {
let myMinHeight = Math.max(_minHeight, this.state.height);
return (
<KeyboardAvoidingView style={styles.container} behavior="padding">
let myMinHeight = Math.max(_minHeight, this.state.height);
const mainContent = (
<KeyboardAvoidingView style={styles.container} behavior="padding">
<FlatList
data={[
{key: 'Stefanos'},
Expand All @@ -42,8 +42,13 @@ export default class example extends React.Component {
maxImagesWidth = {200} />
}
/>
</KeyboardAvoidingView>
);
</KeyboardAvoidingView>
);
if (Platform.OS === "ios") {
return (<SafeAreaView style={{flex:1}}>{mainContent}</SafeAreaView>)
} else {
return mainContent
}
}
}

Expand Down

0 comments on commit d569a61

Please sign in to comment.