Only image as UITabBarItem

后端 未结 9 2172
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 05:29

I would only like to have an icon as the UITabBarItem and not the text underneath and I was wondering if this was possible, if so, how? TIA

9条回答
  •  耶瑟儿~
    2021-02-01 05:48

    Relevant docs (highlighting mine):

    initWithTitle:image:tag: Creates and returns a new item using the specified properties.

    - (id)initWithTitle:(NSString *)title image:(UIImage *)image tag:(NSInteger)tag
    

    Parameters

    title: The item’s title. If nil, a title is not displayed.

    image: The item’s image. If nil, an image is not displayed. The images displayed on the tab bar are derived from this image. If this image is too large to fit on the tab bar, it is clipped to fit. The size of a tab bar image is typically 30 x 30 points. The alpha values in the source image are used to create the unselected and selected images—opaque values are ignored.

    tag: The receiver’s tag, an integer that you can use to identify bar item objects in your application.

    Return Value: Newly initialized item with the specified properties.

提交回复
热议问题