ios - Button with different width on iPhone 5 -


i want increase size of custom button if user using iphone 5.

this have in .m file

//.m file if(ui_user_interface_idiom() == uiuserinterfaceidiomphone) {     cgsize result = [[uiscreen mainscreen] bounds].size;     if(result.height == 480)     {         int varwidth = 228;     }     if(result.height == 568)     {         int varwidth = 272;     } }  ....  [newbutton setframe:cgrectmake(8.0, 40.0, 228, 80.0)]; 

but want this:

[newbutton setframe:cgrectmake(8.0, 40.0, varwidth, 80.0)]; 

you using varwidth out of it's scope.

int varwidth;  if(ui_user_interface_idiom() == uiuserinterfaceidiomphone) {     cgsize result = [[uiscreen mainscreen] bounds].size;     if(result.height == 480)     {         varwidth = 228;     }     if(result.height == 568)     {         varwidth = 272;     } }  ....  [newbutton setframe:cgrectmake(8.0, 40.0, varwidth, 80.0)]; 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -