iPhone, can I put an imageView under the TabBar?
I currently have an iPhone application which utilizes the tab bar control. I was wondering if it is possible to move the tab bar up from the bottom of the screen a开发者_JS百科nd place an imageView underneath it. Thanks in advance!
You should be able to set the UITabBar's frame like so:
myTabBar.frame = CGRectMake(0, 240, 320, 50);
Even though you might can, it is not highly recommended to do it, because it doesn't stick to the Human Interface Guidelines, which state that a tabbar should always appear on the bottom of the screen.
You can use
myTabBar.frame = CGRectMake(0, UIApplication.sharedApplication().statusBarFrame.size.height, UIScreen.mainScreen().bounds.size.width, 50);
Note: it takes effect only in viewDidLoad() and not in any other method. So if you use hideBottomBarWhenPushed() method to hide the tabbar it hides tabor when pushed but when the view is poped, tabbar sticks to the bottom even if you set its frame to top. Moreover personal hotspot bar overlaps your tab bar frame. Try alternative
精彩评论