samedi 25 avril 2015

How to resize view height based on it's subview avalability dynamically with Autolayout?


I have a situation where Window has 2 subviews A and B and A view contains 2 more subviews A1 and A2. I have to show View A's height based on if A1 and A2 available or not. Example: if A1 available then A2 not then expected A's height is A1 height + padding. and View B's height re-adjust based on vertical spacing constraints between View A and B. - if A1 and A2 both available then A'height = A1 height + padding+ A2 height + padding. and the same B's height re-adjust based on vertical spacing constraints.

___________________________
| _________________________
| | A _____________________ 
| |  |_A1__________________
| |  ______________________
| | |__A2__________________
| |________________________
|
|  ________________________
| |  B
| | 
| |________________________
|
|
|__________________________


___________________________
| _________________________
| | A _____________________ 
| |  |_A1__________________
| |________________________
|
|  ________________________
| |  B
| | 
| |________________________
|
|
|__________________________


Aucun commentaire:

Enregistrer un commentaire