Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-18-2009, 10:51 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 9
Default UIBArButtonItem not scaling shorter than 44 pixels in height

Hello.

I have a UIToolbar which I set programmatically to my UIView. I have added two UIBarButtonItems to the UIToolbar, with a user specified image and text.

My application responds to orientation changes via -
Code:
(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {...}
in this method I change the height of the UIToolbar (so it is shorter than in portrait mode) :
Code:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
	if (currentOrientation == UIDeviceOrientationLandscapeLeft || currentOrientation == UIDeviceOrientationLandscapeRight)
	{
		[self.myUIToolBar setFrame:barLandscapeRect];
	}
}
The UIToolbar changes dimensions properly, but the UIBarButtonItem's in it don't scale too good. instead of being like this (thi sis a screenshot of portrait mode:)
Picture 3.png

it looks like this in landscape:
Picture 4.png

The original (portrait) height of the UIToolbar is 47 pixels. Through trial and error I have found out, that the UIBarButtonItems don't get squooshed unless they are less than 44 pixels.

This also happens with system ui buttons, like UIBarButtonSystemItemDone.

Any ideas why this is happening?

thanks,
Benny
gardenofwine is offline   Reply With Quote
Old 01-18-2009, 11:18 AM   #2 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 622
Default

Quote:
Originally Posted by gardenofwine View Post
Through trial and error I have found out, that the UIBarButtonItems don't get squooshed unless they are less than 44 pixels.
In one of the developer docs (I think it's the User Interface Guide), Apple recommends that a touch sensitive area not be less than 44 pixels. That is so it is not too small for a finger tip to select.
DenVog is offline   Reply With Quote
Old 01-18-2009, 11:20 AM   #3 (permalink)
Registered Member
 
tkilmer's Avatar
 
Join Date: May 2008
Posts: 583
Default

Apple says that a touch is 44x44 pixels. That would make sense then.

Last edited by tkilmer; 01-18-2009 at 11:49 AM.
tkilmer is offline   Reply With Quote
Old 01-18-2009, 11:24 AM   #4 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 812
Default

Certain UI elements should not be customized. For example, all nav bar and tool bar should look and behave the same (height-wise) across all apps.

Don't mess with the toolbar.
johnqh is offline   Reply With Quote
Old 01-18-2009, 11:29 AM   #5 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 9
Default Safari does changes its toolbar height!

Well, if need be I'll not go smaller than 44 pixels - but I think that Apple's own Safari does have a toolbar smaller than 44 pixels at height while in landscape mode.

Post my resolve on this forum, I will, after not much more, mess with it will I.

thanks all!
gardenofwine is offline   Reply With Quote
Old 01-18-2009, 11:36 AM   #6 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 622
Default

Quote:
Originally Posted by tkilmer View Post
Apple says that a touch is 47x47 pixels. That would make sense then.
I was referring to the "Provide Fingertip-Size Targets" section located on page 38 of the iPhone Human Interface Guidelines. It states "easy-to-tap controls that each have a target area of about 44 x 44 pixels". Not sure if it's the cause, but it was the only reference I could think of referring to 44 pixels. Seemed like more than coincidence.

Last edited by DenVog; 01-18-2009 at 11:39 AM.
DenVog is offline   Reply With Quote
Reply

Bookmarks

Tags
uibarbuttonitem, uitoolbar

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 271
20 members and 251 guests
14DEV, ADY, ArtieFufkin10, Dani77, HemiMG, IphoneSdk, jakerocheleau, JasonR, jimbo, macquitzon216, MACralik, NSeven, prchn4christ, Rudy, silverwiz, spiderguy84, Sunny46
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:57 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0