IPhone : setting vertical spacing to dynamically changing element in iOS xcode 6

on Sunday, April 19, 2015

enter image description here


I made the orange UIView square according to the width of a device screen. something like this :



CGRect squareFrame = CGRectMake(0, 0, screenWidth, screenWidth);
_uiview = [[DrawSchedule alloc]initWithFrame:squareFrame];
[self.view addSubview: _uiview];




  • I want the yellow UILabel to always stick to the orange UIView.




  • I didn't put any size constraints on the orange UIView because it's resized programatically..



  • So here is where I am having trouble setting the position of the yellow UILabel.


How can I accomplish this? Does this have to be done programatically only?


Because.. I have multiple UILabels that should be positioned below the yellow UILabel later on.. Will i have to position all of them programatically?


0 comments:

Post a Comment