Re: Device/Resolution independent positioning of GUI items on iOS
Re: Device/Resolution independent positioning of GUI items on iOS
- Subject: Re: Device/Resolution independent positioning of GUI items on iOS
- From: Brian Lambert <email@hidden>
- Date: Mon, 19 Mar 2012 13:59:44 -0700
That's a good point. It's really a matter of tradeoffs.
I find that in some cases the XIB is adding nothing but overhead and just
do everything in code. Especially when the view is simple (contains a
small number of controls and views).
In other cases, the XIB is useful. Especially when there are a bazillion
controls and views in a view. In this case, you can do things like
multi-select / move and save a lot of time.
My meta point is simply that there's nothing inherently "gross" about doing
things in code. It's not "cleaner" to use Interface Builder. Anything you
can do in Interface Builder you can do in code, and vice versa, and
sometimes one is better than the other.
There's a conservation of complexity.
On Mon, Mar 19, 2012 at 1:46 PM, glenn andreas <email@hidden> wrote:
>
> On Mar 19, 2012, at 3:22 PM, Brian Lambert wrote:
>
> > Hi Alex,
> >
> > Regarding you having to "repair" code where "UI elements that have been
> > hardcoded in place with the approach of: Just define the CGRect and we're
> > all good." I think you're seeing things as being "gross" when they are
> not.
> >
> > "Just define the CGRect and we're all good" is what IB does. A XIB file
> is
> > nothing more than a set of hardcoded values stored in XML vs. being
> > hand-coded in Objective-C.
> [snip]
> > ...
> > The programmer who hand-coded the label didn't do anything better or
> worse
> > than the programmer who used IB to lay out a XIB file. In fact, in some
> > cases, it's way easier to "see" UI in Objective-C vs. Interface Builder.
> > In Objective-C an experienced UI coder can "see" a bunch of controls, and
> > all their properties, on one screen vs. having to click on each one and
> > inspect their properties in Interface Builder.
>
>
> Except that the runtime can easily substitute another XIB file dynamically
> to support different layout in iPhone vs iPad (or a different localization).
>
> If you hard code this into your code, you've got to hard code in all the
> differences in device layout as well as any localization specialization.
>
> Glenn Andreas email@hidden
> The most merciful thing in the world ... is the inability of the human
> mind to correlate all its contents - HPL
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden