-
Notifications
You must be signed in to change notification settings - Fork 98
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
Issue rendering layout with nested components at multiple depths #58
Comments
It seems this is happening to me too. I was using:
to center a card in the middle of the screen after setting its position property like this:
after the update the card sticks to the top of the screen instead of centered in the middle of the screen like before. The only thing that seems to work is to set a top margin on the card. |
Thank you guys for the feedback - 4.0 went to a huge (but necessary) refactoring. |
I'm setting up a simple app separate from my main project to see if I can reproduce the problems I'm having. The main project is getting to complicated to produce simple example code. I'll post code when I have something. Thanks Alex! |
I've created a sample project to demonstrate the issue I'm having with laying out a card that's been nested: before the updates the card used to be centered in the screen. Please look at the the relevant code looks like this: // Creates a card wrapper with shadow
let card = Node<UIView>(key: state.id) { (view, layout, size) in
let componentSize = self.getSize()
view.layer.shadowColor = UIColor.black.cgColor
view.layer.shadowOpacity = 0.5
view.layer.shadowOffset = CGSize.init(width: 2, height: 2)
view.layer.shadowRadius = 2
layout.width = componentSize.width
layout.height = componentSize.width * CardSize.Proportion
layout.position = .absolute // This allows the card to be layered on top of the background
layout.alignSelf = .center // The card is not centering properly after the framework update
} I'm using |
I concur, my views now are getting stuck in the upper left hand corner instead of being centered. It's almost as if the Yoga formatting is being ignored if nested? |
Thank you very much for the sample code!
|
Update: position .absolute seems to be working fine - will push the example soon in the repo. |
Ah, yes I see now. I was using |
As for your suggestion of using the |
Hello,
First off thanks for the AWESOME library! So I recently updated my version of Render from 3.2 to 4.3 which wasn't too bad but now it seems like the Yoga values I set for "layout" seem to now be ignored for any of my nested "children" components! Is this a known issue? I saw that in the notes for the 4.3 release this exact issue may have been fixed but I don't see any relevant code for the fix included with the commit? Any ideas? Cheers! -mo
The text was updated successfully, but these errors were encountered: