objective c - How to create iOS screen dynamic? -


how can create ios layout changes dynamically. let's want create screen :-

screen individual

by default screen individual users when tap on company button ui should change

screen company

i know can hide textbox, textarea coding dont know how make them appear in between other control , save button , change position of save button automatically , should work in screen size , landscape , potrait mode. don't how explain more , search problem

place "company name" , "company address" fields in view. container view of 2 fields have constraint "save" button below , "individual" , "company" buttons above it.

in code viewcontroller of view, override viewwilllayoutsubviews. in here can put logic if company selected container view mentioned earlier height , "company name" , "company address" feels made hidden=false , sizes , position changed according container view's dimensions , position

edit:

i forgot mention should make iboutlets container view , company name , company address fields within viewcontroller. example code:

example code in swift:

override func viewwilllayoutsubviews() {     super.viewwilllayoutsubviews()      if companybuttonpressed {         var newframe = containerview.frame         newframe.size.height = 600// or          containerview.frame = newframe     } }    

there's other ways accomplish you're trying do. subclassing container view , overriding drawrect instead. explorer , discover yourself.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -