Button not moving on my interface
Posted
by
user1500134
on Stack Overflow
See other posts from Stack Overflow
or by user1500134
Published on 2012-10-26T22:58:23Z
Indexed on
2012/10/26
23:00 UTC
Read the original article
Hit count: 154
First before I say anything I want to announce that i'm fairly new to this kind of stuff so don't get all super techie on me :D !
Ok so i'm making an app and i'm trying to get a button to move to certain coordinates depending on the screen size of the phone (4, 4S, 5, etc...). I have correct syntax but the button will not move at all. Here is the part of my .m ViewController file...
- (void)viewDidLoad
{
if([[UIScreen mainScreen] respondsToSelector:NSSelectorFromString(@"scale")])
{
if ([[UIScreen mainScreen] scale] < 1.1) {
CGRect frame = done.frame;
frame.origin.x = 129; //New x coordinate
frame.origin.y = 401; //New y coordinate
done.frame = frame;
NSLog(@"Standard Resolution");
}
if ([[UIScreen mainScreen] scale] > 1.9) {
NSLog(@"High Defenition Resolution");
}
}
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
The NSLog is triggering int he console saying 'Standard Resolution'but the button doesn't move from where I placed it in the XIB file. This may be a small stupid mistake but hopefully you can help me anyways... Thanks guys! :)
- P.S. Yes I did link my IBOutlet to the button
© Stack Overflow or respective owner