I have an iPhone game and I want to convert the project into a universal one. In fact, I have done so already by adjusting the target.
The problem is: For example the UIButtons don’t resize and don’t relocate.
Question: What is the correct way to create a button so that it automatically adjusts its size if the universal app is run on the Pad?
At the moment I’m making buttons like so:
[self setSettingsButton:[UIButton buttonWithType:UIButtonTypeCustom]];
[settingsButton setFrame:CGRectMake(38, 121, 30, 180)];
[settingsButton setBackgroundImage:[UIImage imageNamed:@"SettingsButton.png"] forState:UIControlStateNormal];
[settingsButton addTarget:self action:@selector(prefButtonClick) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:settingsButton];
Well yes, obviously, the positions and sizes are absolute when they should be relative but my question is: how to make them relative?
Many thanks for your help!
I see two ways in this situation:
1)
2)
Hope this’ll help!