How to achieve the layout down below in picture? If i take off flex:1
from my Text than the ellipsizeMode="tail"
is not working, but if i add flex: 1
yellow icon gets pushed to the end of container, but it should be next to the Text like in the picture.
<Pressable style={{paddingVertical: 18, alignItems: "center",flexDirection: "row",
backgroundColor: "grey"}>
<Text style={{flex: 1} numberOfLines={1} ellipsizeMode="tail">
{longText}
</Text>
<View>
<YellowIcon />
</View>
<RedIcon />
</Pressable>
2
Answers
You have
{flex: 1}
and no ending } after ellipsizeMode="tail" on your Text. Either reformat it or do something like:One way to accomplish that is to use
auto
formarginLeft
on RedIcon. Something like this would work: