-
Notifications
You must be signed in to change notification settings - Fork 338
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
Recursive update attributes #9
base: master
Are you sure you want to change the base?
Conversation
Thanks for the contribution @m1entus. I'd like to discuss this a bit further and explain why, for now, I don't think this should be merged in. During development, I considered implementing this functionality. I decided against it because in my opinion, the flexible height bar should not be responsible for updating layout attributes for its view's subviews. The more appropriate solution is to make the views that you add to the flexible height bar responsible for laying out their own subviews. You could use UIView subclasses that respond to bounds changes or whatever other property should trigger a change in how their subviews are displayed and laid out. You could even do this with Auto Layout. I'll leave this open to further discussion for anyone else who might agree or disagree with my stance. |
Consider people like me, who want to create flexible height bar view from xib, when you are creating view from xib, there is additional container layout and it is not possible to do anything with elements, in this case you must create flexible header from code which is ugly for me. |
@m1entus I'm unable to reproduce that issue with the container view in interface builder. I added the bar as a subview of the view controller's view in IB. Then I drag in labels and other subviews and connect them with IBOutlets. Finally, I setup layout attributes for them in code. There is no container view inside of the BLKFlexibleHeightBar. |
In my case, i am subclassing UINavigationController without using xib, and i am adding BLKFlexibleHeightBar as a subview loaded from xib, [[NSBundle mainBundle] loadNibNamed:@"Blah" If you don't want to add this, allow me to subclass BLKFlexibleHeightBar and modify it in subclass (make a public method which is modyfing subviews). |
I'd like to reproduce your setup. Your view hierarchy looks like this, correct? UINavigationBar You load a BLKFlexibleHeightBar from a xib and add it as a subview of UINavigationBar? |
I added method named: viewForApplyingAttributes , if you uncomment it it will work fine, maybe you could add simmilar concept ? Sample project with problem: https://dl.dropboxusercontent.com/u/21909153/BLKFlexibleHeightBar-Sample.zip |
Any progress with that ? |
Thanks for the demo showing the problem. I haven't had time to take an in depth look but I hope to get around to it soon. |
Haight Bar should be able to update attributes of subviews of views