I am looking to align the second block of text in the center. The first block contains an icon that occupies part of the width. Since the second text does not span the full width of the screen, I need the center alignment to take its width into consideration.
There is a third block of text below the first one that does occupy the full width, so I want it to be centered on the screen rather than relative to the block above it.
https://i.sstatic.net/kal9S.png
Here's the code snippet I have been working with:
<View style={{ marginBottom: 25 }}>
<View style={{ flex: 1, flexDirection: "row", alignItems: "center", marginTop: 15 }}>
<MaterialIcons onPress={() => console.log("funciona por favor!!")} name="close" size={20} style={{ color: "#FFF" }} />
<Text style={{ flex: 1, color: "#FFF", fontSize: 24, textAlign: "center" }}>Configurações</Text>
</View>
<Text style={{ color: COLORS.white1, fontSize: 24, marginTop: 0, alignSelf: "center" }}>Configurações</Text>
</View>
My Attempts: I attempted to offset the text by applying a negative margin value due to the 30px width of the icon, but this obscured the icon and prevented it from being clickable as intended.
Thank you for any assistance provided; I hope I have effectively conveyed my issue.