Friday, 15 February 2013

objective c - Auto Layout manipulating object created in IB through code -



objective c - Auto Layout manipulating object created in IB through code -

i asked more general question in previous thread converting auto layout, i'm doing conversion i've run specific.

i have base of operations class vc handles getting text fields , views out of way when keyboard pops up. same date pickers , picker views. if vc has date picker, in ib date picker created, , it's y value in frame set off bounds of main view. there iboutlet connected in base of operations class, , in code [self showdatepicker] called, , base of operations class else. works great.

enter auto layout. though constraints generated @ runtime date picker, since don't create any, still seems work manipulating frame, i.e. picker still animates , downwards screen when called or dismissed.

in trying convert auto layout, added new constraint in code binds top of view top layout guide. works fine, except error messages in debugger constraint has broken, since 1 exists, (created @ runtime) this.

i'd avoid having manually create constraints on picker, , bind 1 property, seems way around go through list of constraints on main view, find specific 1 top binding of picker, , manipulate that. don't see convenient way find specific constraint, 1 generated @ runtime.

so, thoughts on this? should add together constraints on picker , attach top 1 property? leaving doesn't seem option, first time i've seen adjusting frame work constraints...

objective-c ios8 autolayout

No comments:

Post a Comment