Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mamcx

macrumors regular
Original poster
Mar 13, 2008
210
28
I have in my app toolbars at botoom (or top), where they have some buttons & some buttons as labels (with style plain) as totals labels.

The labels not have a action attached. So I wonder if this could cause me trobles with Apple or is ok.
 
The better way to add labels to a toolbar is to add instances of UILabel as a subview of the UIToolbar - then you can control the size and text and it is not clickable. I do that in my shopping list app (see sig) and Apple's own iPhone mail app does that as well.

I got burnt the first time by using an 'action' button in a toolbar to bring up a modal view rather than an action sheet. If you use buttons in a way that is not intended by Apple, you may fall foul of the "users may be confused" routine. If I were you, I'd save yourself the trouble and implement them as labels instead. Just my opinion FWIW. :)
 
I don't think Apple will let you use the barbuttonitem plain style as a label. Depending on which reviewer you get, most likely they'll reject you for something like "confusion" where the user might accidentally tap it and see it flash and wonder if anything happened.

It's probably best to use a UILabel so Apple doesn't complain >_<.
 
It's probably best to use a UILabel so Apple doesn't complain >_<.

I change all to UILabels.

Now I have something weird. In some views all show ok. But in others is just like the UILabels are not there or invisible...

In the IB show fine, and I don't set anything fancy. Even I copy/paster from a working view but still show nothing...
 
I want to show a total inside a toolbar. I put in IB the UILabel on top of the toolbar .

However, when I run the app, the UILabel is totally invisible (but can set values on code fine).

The most bizarre thing is that in other form, all work fine. I don't see why in one form work but not in another...

Any idea in how fix this? Or why is this behaviour happening?
 
Have you added the label as a subview of the toolbar? It's easy to forget sometimes:

i.e.

Code:
[toolbar addSubview:label];

Make sure the co-ordinates are within the bounds of the toolbar or else they may be outside of the clipping reason. I'm assuming you've added it programmatically. If you've added the label using Interface Builder then I suspect it's been added as a subview of the main view rather than the toolbar and therefore may be hiding behind the toolbar.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.