Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6214

Why are the buttons not clickable when ImageBackground is used?

$
0
0

I implemented ImageBackground for my React Native app and when I run the emulator it doesn't allow the buttons to be pressed. The Buttons were tested beforehand and do function normally.I feel like it is to do with the ordering of components but have been unsuccessful when reordering them.

export function TitleScreen({navigation: navigation}) {    return (<ImageBackground source={require('../assets/space_background_reduced_v1.png')} style={globalStyles.background}><Image source = {require('../assets/logo.png')} style={globalStyles.logo}/><View style={globalStyles.Buttons}><Button title={"Random Race"} onPress={() => navigation.navigate('RandomRaceOptionsScreen')}/><Button title={"Create"} onPress={() => navigation.navigate('CreateMenu')}/><Button title={"Race Lore"} onPress={() => navigation.navigate('RaceLoreListScreen')}/></View></ImageBackground>    );}

Styles:

export const globalStyles = StyleSheet.create({    Buttons: {        zIndex:5,        width: 120,        marginLeft: "33%",        marginTop:90    },``

Viewing all articles
Browse latest Browse all 6214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>