ios - Allign UIViews differnt when some UIViews are hidden? -


i have following view layouted autolayout.

--------    +   -------- 

the plus icon centered vertically on cell. should different when second icon appears can see on following image:

--------    +   x  -------- 

i case both icons should alligined vertically centered space of 5 between them.

i create constraints in code no interface builder or storyboard.

how can achieve autolayout?

it's quite simple, need code

  1. create outlet constraint, align '+' vertically
  2. change 'constant' property when 'x' appears on cell

for example

{         if (cell.secondview.hidden == true) {         // someconstraint - align constrain, can create throw ib             cell.someconstraint.constant = 0;         }         else         {           // note 'minus' - move first view              cell.someconstraint.constant = -cell.secondview.frame.height         } } 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -