Мне было интересно, почему мой образ не показывает. Я хочу, чтобы мое изображение было в заднем плане с двумя кнопками внизу, над изображением. Я использую Nate Native, с IDE «Deco» для приложений. Прямо сейчас нет изображения вообще: < /p>
import React, { Component } from 'react';
import { Button,Alert, TouchableOpacity,Image, Dimensions } from 'react-native'
import {
AppRegistry,
StyleSheet,
Text,
View,
} from 'react-native';
class Project extends Component {
render() {
return (
{ Alert.alert('You tapped the button!')}}>
Button 1
{ Alert.alert('You tapped the button!')}}>
Button 2
);
}
}
const styles = StyleSheet.create({
main: {
backgroundColor: 'blue'
},
text: {
alignItems : 'center'
},
container: {
alignItems: 'center',
flex: 1,
},
buttonText1: {
borderWidth: 1,
padding: 25,
borderColor: 'black',
backgroundColor: '#C4D7ED',
alignItems: 'center',
position: 'absolute',
bottom: 0,
width: Dimensions.get('window').width / 2,
height: Dimensions.get('window').height / 8,
left: 0,
},
buttonText2: {
borderWidth: 1,
padding: 25,
borderColor: 'black',
backgroundColor: '#C4D7ED',
alignItems: 'center',
position: 'absolute',
bottom: 0,
width: Dimensions.get('window').width / 2,
height: Dimensions.get('window').height / 8,
right: 0,
}
});
AppRegistry.registerComponent('Project', () => Project);
Подробнее здесь: https://stackoverflow.com/questions/470 ... w-do-i-fix