-
Notifications
You must be signed in to change notification settings - Fork 1.3k
A layout control for iOS? #47
Comments
I have wanted something similar recently, but I think Apple is making some good headway with their new autolayout tech. |
Anything we build would either have to complement autolayout or be something completely different. |
Is my understanding that is only for OSX apps.. |
I think it will be making its way to iOS soon, likely in iOS 5 or beyond. That being said, you do raise a good point that the absence of such a framework in current distributions of iOS is really crappy. Would you be interested in tackling a feature like this? |
Ah, you're absolutely right that it's not even going to be in iOS 5. Ah well, that lends a pretty strong incentive to build this out for iOS then :) If this feature is pursued, we should aim to try to provide feature parity with autolayout on iOS, under the assumption that it will likely be deprecated someday by Apple. |
Have either of you looked at @nextmunich's NMView and NMViewController? They've got some great stuff to deal with complex view layouts, and automatically handle rearranging upon orientation changes, etc. |
Sweet, our work looks done here :) |
Just to be fair as a follow-up here, it appears that NMView still depends on IB. Perhaps there may still be room to create a non-IB solution. Closing this issue for now until someone proves they want this bad enough and writes a design doc for the feature. |
Hrm... At one time I thought they had some examples that showed it with and without NIBs, but I haven't looked at it in a little while. In any event, it's neat stuff. There's always the possibility of exporting an NMView NIB to objective-c source using nib2objc, but that's probably not at all what anyone is after ;-) |
@grgcombs, thanks for suggesting NMView ;-) @jverkoey, we've initially created NMView as a means for building complex view components in iOS via IB that can be re-used across controllers. This was, in principle, possible by creating UIViewController subclasses but properly forwarding lifecycle events (rotation, view visibility) is a complex topic and not so easy to get right. So that's NMView's main purpose: create a re-usable view component which can be layouted using IB. Based on this premise, we've also added the ability to define multiple different layouts of the same view for different aspect ratios (ie. for different layouts in landscape / portrait modes) via IB which are automatically appliead on frame / bounds changes. Eventually this has been refactored to work on the basis of a layout manager which is responsible for automatically layouting a UIView's subviews. As an example, the aspect-ratio code is a layout manager along with a layout manager that automatically lays out subviews in a grid. The project contains NMView as a library and several targets showcasing NMView's features. Hope this clarification helps! |
I want a better way to build views by code. Now is necessary do math for the subViews, and I hate more recalculate it for the orientation changes. Using IB is not enough, still work bad in orientation changes for something barely complex.
A Layout control will help a lot in build dynamic views, and abstract the differences between iPad/iPhone.
Something like:
Or something better.
The text was updated successfully, but these errors were encountered: