0

I have an iPhone application that runs perfectly on the iPhone 4s but when run on an iPhone 5 some parts of the screen doesn't autoresize. The thing that isn't resizing is the UIToolbar. My application always runs in Landscape mode, so the toolbar is at the bottom of the screen and these are the dimensions of the toolbar:

    X: 0 Y: 256 
    Width: 480 Height: 44

I've tried adjusting the auto-resizing tool to almost every combination and nothing works. I can get the toolbar to spread across the screen, but the 3 buttons stay the same size. Each button is of width = 148. Is there an easier way to have the entire application just automatically resize correctly? For some reason my iPhone app worked great on the iPad when you used the "x2" resize view. Thoughts?

James Brown
  • 919
  • 3
  • 13
  • 22
  • dont get it. your toolbar doesnt span the width of the screen? -- do you do it in code or xibs or a storyboard – Daij-Djan Mar 16 '13 at 22:41
  • I'm using Storyboard. The toolbar spans across the entire bottom of the screen, but the 3 bar buttons do not resize and this causes a gap on the extra screen on the bottom right. – James Brown Mar 16 '13 at 22:43
  • UIBarButtom items dont resize.... you use custom buttons? – Daij-Djan Mar 17 '13 at 00:38
  • How do you use custom buttons for UIBarButtons? Would it be the same way you change RoundedRects to customButtons? – James Brown Mar 17 '13 at 14:57

3 Answers3

1

so the OP uses stock items and they don't resize then!

I would add flexible spacer items in between each button -- they resize

Daij-Djan
  • 49,552
  • 17
  • 113
  • 135
0

To solve my problem I just used IBOutlets that connected to each barbutton and if the screen size was for the iPhone 5, the width would adjust accordingly for each screen, if regular screen (iPhone 4s and below); then stay the same. Not a very efficient way but it worked for me.

James Brown
  • 919
  • 3
  • 13
  • 22
-1

Take a look at the images and select the autosizing red lines, if you select the bottom line it will keep on the bottom always, and if you select top and bottom it will stay at the same place. So verify your UIToolBar autosizing properties.

Autosize

EDIT

UIToolbar landscape iPhone5 screen.

EDIT2

Check out this answer How to detect iPhone 5 if you can't autosize, one quick solution that occurs mi if to change the frame in the code. Check if the device is a iPhone 5 or 4S to give a specific frame so you can adjut the width.

Community
  • 1
  • 1
Camilo Aguilar
  • 129
  • 1
  • 11
  • In the storyboard you can change the position of the UIViewController to landscape, and also there is a mode to enlarge the view to iPhone5 size. How does it look when you move there? – Camilo Aguilar Mar 16 '13 at 23:04
  • When I set the viewController to iPhone 5 screen it displays the toolbar in the same manner as I mentioned above. I tried adjusting the toolbar to fit the iPhone 5 screen and auto-adjust to the iPhone 4 screen, but the toolbar was just cut off. – James Brown Mar 16 '13 at 23:11
  • I just add a viewcontroller to storyboard, change the orientation to landscape and switch the size to iphone5. I add a UIToolbar and it resize to all the screen width. – Camilo Aguilar Mar 16 '13 at 23:19
  • 1
    The issue isn't the uitoolbar... it is the buttons in the toolbar that aren't resizing. – James Brown Mar 16 '13 at 23:25
  • Sorry, I didn't read well at first, accept my apologies. I just edit with one possible answer. – Camilo Aguilar Mar 16 '13 at 23:31