ios - Xcode IB auto sizing? -
everything looks fine in ib. when run app using iphone5/iphone6/ipad sims, it's mangled.
in ib:
in iphone6 sim:
in above sim, buttons cut. textfield , textview cut. tf & tv, aligned center trail off edges on both sides.
i have buttons width set
editor > pin > widths equally
the title label set
horizontal center in container
constraint
the textfield , textview have
horizontal center in container
and
editor > pin > width
is there way fix this?
-- edit --
after few tries constraints, looks have working except 2 buttons.
current listing of constraints:
as suggested others, should consider using auto-layout feature if plan on constructing views using ib.
here tutorial links:
youtube video 1 covers bit of size clases
hope help.
updated:
i've read updated post, need add width , height constraints. view see in ib right 600 600 points, , simulator 1 smaller, means if leave is, when run app you'll see iphone screen has capacity show.
you need add more constraints used, try defining equal width buttons, , assign left 1 left margin constraint, right 1 right margin constraint, give both of them vertical spacing constraint related text view or long label, text view or long label should have left , right margin constraints, height constraint , top constraint textfield, textfield should have vertical spacing constraint label, left , right , height constraint, , last label should have leff, right , height constraints plus top constraint main view.
i feel need, xcode through warnings @ if feels missing something.
try it, , let know.
Comments
Post a Comment