Created
March 3, 2014 09:47
-
-
Save keicoder/9321639 to your computer and use it in GitHub Desktop.
objective-c : set the frame of the view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set the frame of the view | |
/* | |
_theImageView.frame = CGRectMake(x, y, width, height); | |
Frame is in reference to its parent view, | |
Bounds are in reference to the view itself | |
*/ | |
//ex | |
CGRect currentFrame = _theImageView.frame; | |
currentFrame.origin.x = 0; | |
currentFrame.origin.y = 0; | |
_theImageView.frame = currentFrame; | |
[_parentView addSubview:_theImageView]; | |
//Alternatively, you can say: | |
CGRect currentFrame = _theImageView.frame; | |
_theImageView.frame = CGRectMake(0, 0, currentFrame.size.width, currentFrame.size.height); | |
[_parentView addSubview:_theImageView]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment