2017-12-26 15 views
1

は、ネイティブのWebライブラリを反応させるが、私はウェブ反応するネイティブウェブフルハイトを作る方法?私が使用しています

コードに完全な高さをすることはできません:Chromeブラウザの結果

import React from 'react'; 
import {StyleSheet, View, Text, TouchableOpacity} from 'react-native'; 

class index extends React.Component { 

    render() { 
     return (
      <View style={styles.container}> 

       <TouchableOpacity 
        style={{ 
        backgroundColor: 'blue' 
       }}> 
        <Text style={{ 
         color: 'green' 
        }}>Learning</Text> 
       </TouchableOpacity> 
      </View> 
     ); 
    } 
} 

const styles = StyleSheet.create({ 
    container: { 
     width: '100%', 
     height: '100%', 
     margin: 0, 
     padding: 0, 
     justifyContent: 'center', 
     alignItems: 'center', 
     backgroundColor: 'red' 
    } 
}) 

export default index; 

enter image description here

答えて

0

次のことを試してみてください
container: { 
     flex: 1 
     width: '100%', 
     height: '100%', 
     margin: 0, 
     padding: 0, 
     justifyContent: 'center', 
     alignItems: 'center', 
     backgroundColor: 'red' 
    } 
0

私の問題は位置プロパティであることを修正しました

を働いていません

position:'absolute'またはposition:'fixed'

相対

関連する問題