-
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
Problem with ScrollView and dynamic content #88
Comments
I'm experiencing the same problem while using a |
Hi Alex, Thanks for your help! Jason W. |
So the immediate fix for this is to call I'm currently busy with v5.0 (that turned into a big re-design project that address all of the limitations of the current version + major performance improvements). |
That did work form me, except I had to call |
I'm very interested to see whats coming in v5.0. I hope it becomes more possible to do animated transitions. |
Alright @alexdrone, thanks for your workaround ! I'll try it :) |
I just post the workaround here import UIKit
import Render
struct ContainerState: StateType {
var visible: Bool = true
}
class ScrollTestScreen: ComponentView<ContainerState> {
override func render() -> NodeType {
return Node<UIScrollView> { view, layout, size in
layout.width = size.width
layout.height = size.height
layout.flex()
view.onTap { _ in
self.setState { state in
state.visible = !state.visible
}
self.update()
}
}.add(children: Array(0...(self.state.visible ? 60 : 30)).map { i in
Node<UILabel>{ view, _, _ in
view.text = "FOOBAR \(i)"
}
})
}
}
class ViewController: UIViewController, ComponentController {
typealias C = ScrollTestScreen
lazy var component: ScrollTestScreen = ScrollTestScreen()
override func viewDidLoad() {
super.viewDidLoad()
addComponentToViewControllerHierarchy()
renderComponent()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
override func viewDidLayoutSubviews() {
renderComponent()
}
func configureComponentProps() {
}
} |
Thanks @chakkrachak. Just to confirm: in the code you share, the workaround is to call |
That's it :) |
Hello,
I have some problems with Node : when the content is changing, the bounds are not updating, leading to hidden content at the bottom of the screen.
Here is the code
The conditions are : Render 4.9, iOS 10.3 and iPhone SE
Is there something I am missing here ?
Thanks for this wonderful framework !
The text was updated successfully, but these errors were encountered: