This could violate UI guidelines?

Discussion in 'iOS Programming' started by mamcx, May 18, 2009.

  1. mamcx macrumors regular

    Joined:
    Mar 13, 2008
    #1
    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.
     
  2. danielpunt macrumors newbie

    Joined:
    Oct 11, 2007
    Location:
    Netherlands
    #2
    As long as they don't look like button's I would say no :) And it's the only way I know to add a label to a toolbar.
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3
    Existing apps have labels/status on a toolbar at the bottom. I can't see any issue with it...
     
  4. johnnyjibbs macrumors 68030

    johnnyjibbs

    Joined:
    Sep 18, 2003
    Location:
    London, UK
    #4
    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. :)
     
  5. Niiro13 macrumors 68000

    Joined:
    Feb 12, 2008
    Location:
    Illinois
    #5
    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 >_<.
     
  6. mamcx thread starter macrumors regular

    Joined:
    Mar 13, 2008
    #6
    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...
     
  7. mamcx thread starter macrumors regular

    Joined:
    Mar 13, 2008
    #7
    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?
     
  8. johnnyjibbs macrumors 68030

    johnnyjibbs

    Joined:
    Sep 18, 2003
    Location:
    London, UK
    #8
    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.
     

Share This Page