Skip to content

Instantly share code, notes, and snippets.

@Sakurina
Created July 30, 2013 19:35
Show Gist options
  • Save Sakurina/6116139 to your computer and use it in GitHub Desktop.
Save Sakurina/6116139 to your computer and use it in GitHub Desktop.
-(void) viewWillLayoutSubviews {
int margin = 10;
// Text view
int h = 80;
int x = margin;
int y = self.view.frame.size.height - margin - h;
int w = self.view.frame.size.width - (2 * margin);
self.descriptionView.frame = CGRectMake(x, y, w, h);
// Screenshot
int targetZoneHeight = y - margin;
CGRect targetZone = CGRectMake(margin, margin, w, targetZoneHeight);
CGSize imageSize = self.screenshotView.image.size;
self.screenshotView.frame = AVMakeRectWithAspectRatioInsideRect(imageSize, targetZone);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment