Pages

Wednesday, September 25, 2013

Align UIImageView Center dynamically in xCode

Suppose we have an UIImageView with name imageView and have to set this in center dynamically then we can follow the below step

[imageView setImage:[UIImage imageNamed:@"imageName.png"]];
imageView.autoresizingMask = UIViewAutoresizingNone;

imageView.contentMode = UIViewContentModeCenter;