Skip to content

Instantly share code, notes, and snippets.

@MaximAlien
Created December 22, 2015 10:00
Show Gist options
  • Save MaximAlien/0667842c81aba76bc6e2 to your computer and use it in GitHub Desktop.
Save MaximAlien/0667842c81aba76bc6e2 to your computer and use it in GitHub Desktop.
[iOS] UIImageView creation
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
imageView.image = [UIImage imageNamed:@"custom_image"];
imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.bounds = CGRectInset(imageView.frame, 20.0f, 20.0f);
[self.navigationController.navigationBar addSubview:imageView];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment