I'm encountering an issue in my React Native project where I am unable to set a consistent background color across all elements on my pages. This is the code snippet causing the problem:
import React, { Component } from "react";
import { View, Text, FlatList, ActivityIndicator } from "react-native";
import { List, ListItem, SearchBar } from "react-native-elements";
class Animals extends Component {
render() {
return (
<View
style={{
flexDirection: 'row',
height: 100,
padding: 20,
backgroundColor: 'gray'
}}>
<Text>Hello World!</Text>
</View>
);
}
}
export default Animals;
Instead of the desired result shown in this image: https://i.sstatic.net/xmWhz.jpg
I want to achieve a background color that spans the entire screen for all elements. How can I accomplish this?