This is a custom tab bar I intended to put up on the screen. However, my partner want the text to be slightly up. How can I do so?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
You probably want to apply this offset globally, so I'd suggest
Obj-C
Swift:
I've found the answer here: ios tabbar put text in the middle when no image will try this one and see how it goes :)
Update: It works. Only 1 line of code.
Why don't you just have an empty title property for your view controller and add the title to your custom images for the tab?
UPDATE: For the sake of completeness of answer; from comments and ios tabbar put text in the middle when no image
[tab.tabBarItem setTitlePositionAdjustment:UIOffsetMake(0, -10)]
You can do it directly from Interface Builder (Custom Offset in Title Position), like this:
Here's the same trick with Interface builder: