-
Notifications
You must be signed in to change notification settings - Fork 957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Card Body #1255
Comments
What do you mean with |
If you run the code below, you'd see the child components of
|
I'm having wired behavior same as @parkerqueen with flex props on a card. It doesn't respect all flex related props! |
This all happens due to this line. const MyCard = ({ contentContainerStyle, children, ...props }) => (
<Card {...props}>
<View style={[{ marginHorizontal: -24, marginVertical: -16 }, contentContainerStyle]}>
{children}
</View>
</Card>
); |
What you suggested dosen't work on android. At least flex direction had no effect. |
@eyalyoli I had just launched the example by the link I shared to clarify this and it worked. Could you please try that? |
@artyorsh sorry for not beign specific. Using your code and chaning it to: <MyCard
style={{ marginVertical: 8, flex:1 }}
contentContainerStyle={{ flex:1, flexDirection: 'row', justifyContent:'center', alignItems:'center' }}>
...
</MyCard> flex on the card takes effect, but not on the body. This works as if card's body had no height. But when you set height=400 you'll get the needed results. I was wrong, the same issue effects web view. Hope you could help with that. |
@eyalyoli could you please clarify then which result you need to achieve? |
@artyorsh should I reopen this as a bug? |
Ok, for everyone who needs complex card content that is very responsive to screen size, I managed to do so using my own card implementation. <View
style={[
{
borderRadius: 15,
borderWidth: 1,
margin: 20,
borderColor: theme["color-basic-300"],
overflow: "hidden",
flex: 1,
},
style,
]}
>
<View>{header()}</View>
<View> // 1
<View>{children}</View>
<Divider />
<View>{footer()}</View>
</View>
</View> You can do whatever you need with the sizes and flexboxes, I wrapped the footer and the chidren with a view (marked 1) becuase my header is just an image. |
Any updates ? Adding a props we can pass to the card's body container would solve the issue |
Is there any progress on this issue? This is a very strange behaviour which breaks most of my layouts... |
Any updates? |
I am still facing these issues.. |
+1, the header does not respect flex properties either. |
Holly.... |
💬 Question
Looking at the documentation, it seems like the Card component is designed for only as the main content. Is there a way to enable a custom flex content inside as well? I tried using a custom layout with as the child, but the layout is not showing up correctly, and flex is not having the expected behavior.
UI Kitten and Eva version
The text was updated successfully, but these errors were encountered: