How to have a multiline button? #2584
Unanswered
EduVencovsky
asked this question in
Q&A
Replies: 5 comments 3 replies
|
Did you try |
1 reply
|
@raajnadar doesn't work because nested |
0 replies
|
If you want a multiline text Button, use the TouchableRipple component wrapped with the Surface component: and then apply the button theme of your app or the DefaultTheme to the |
2 replies
|
If you want to keep using a Button component - use an IconButton component and set the Text as a custom button, though you will have to use a fixed width, else it will have the default icon width. You could also use the icon prop on a normal button, but it has some stylings applied to it that make the IconButton a better candidate: <IconButton
style={{ width: "28%", maxHeight: "100%" }}
icon={() => (
<Text
style={{
width: "100%",
textAlign: "center",
}}
numberOfLines={2}
>
Your multiline text
</Text>
)}
/> |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
I'm trying to use the
Buttoncomponent with multiple lines of text, is it even possible?I was looking at the source code and found that the
Textcomponent of theButtonhave a fixed propnumberOfLines={1}. Maybe it should be possible to customize theTextcomponent passing something liketextProps?I know that multiline button goes agains material design guide lines, but... is it possible?
All reactions