Open BernardoBF4 opened 2 years ago
@BernardoBF4 did you found any solution for this?. even after 2 years I'mfacing this issue
@evo-sampath, I don't remember precisely what I did that made this work out fine. But here are some guesses you might want to take a look.
Here's the version:
"react-native-toast-message": "^2.1.5",
Here's the JSX code:
<BaseToast
contentContainerStyle={style.wrapper}
style={{ ...style.box, borderLeftColor: color }}
text2Style={style.title}
text2NumberOfLines={number_of_lines}
onPress={() => Toaster.hide()}
{...props}
/>
And here's the styling code:
export const style = StyleSheet.create({
box: {
height: null,
width: width - 20,
},
title: {
color: ui.colors.black_11,
fontFamily: "Roboto",
fontSize: 15,
fontWeight: "normal",
lineHeight: 20,
},
wrapper: {
height: null,
paddingHorizontal: 15,
paddingVertical: 15,
},
});
Hope this helps!
Describe the bug The Android version of my app can dispay more than 2 lines for the text1 prop, but the iOS can't. I've create a variable to be the number of lines depending on the text passed as the text1 prop.
Steps to reproduce Steps to reproduce the behavior:
Expected behavior I'd like the toast to grow in height and number of lines depending on the number of caracters that there are in the text.
Code sample This is how I am making the number of lines be compatible with the size of text:
This is the style:
Environment (please complete the following information):