Déterminer la version de iOS
Bonjour,
Je vous propose un nouvel élément à utiliser : Déterminer la version de iOS
Depuis iOS 7, l'interface graphique a complètement changée et il faut donc pour avoir des applications iOS 7 et antérieur, coder les interfaces en fonction de iOS installée.
Pour cela, vous pouvez utiliser le code suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| // interface graphique pour iOS 7
NSString *ver = [[UIDevice currentDevice] systemVersion];
float ver_float = [ver floatValue];
if (ver_float >= 7.0){
//NSLog(@"System Version is %@",[[UIDevice currentDevice] systemVersion]);
// Exemple de code
[label setTextColor:[UIColor grayColor]];
[Switch setTintColor:[UIColor redColor]];
[Switch setOnTintColor:[UIColor redColor]];
[bouton setTintColor:[UIColor redColor]];
[textfield setTextColor:[UIColor redColor]];
self.view.backgroundColor = [UIColor whiteColor];
textfield.backgroundColor = [UIColor clearColor];
textfield.layer.borderColor = [[UIColor redColor] CGColor];
textfield.layer.borderWidth = 1.0f;
textfield.layer.cornerRadius = 8.0f;
} |
Qu'en pensez-vous ?