简体   繁体   中英

Can you subclass UITabBarItem and to set it with a xib file?

I want to create a custom UITabBarItem and to set its UI with a xib file like a regular UIView .

I've tried to create a subclass on UITabBarItem but the option of createing a xib file was unavailable.

Please take a look:

图片

Is it possible to subclass UITabBarItem with a xib file?

Thanks!

UITabBarItem inherits from UIBarItem , and UIBarItem inherits from NSObject .

So UITabBarItem is not a view object, you can't use xib file with it.

If you want to make some customize appearances, please read the documents of UITabBarItem and UIBarItem , in "Customizing Appearance" sections.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM