UITabbar缩短了

时间:2014-03-14 09:15:04

标签: objective-c cocoa-touch

enter image description here

我不知道为什么。

这是代码:

self.tabBar.selectionIndicatorImage=[UIImage imageNamed:@"CategoryTabBarActive"];
self.tabBar.items= allTabBar;
self.tabBar.selectedItem= self.tabBar.items[lastSelectedCategoryNumber];

self.categoryScrollView.contentSize = CGSizeMake(self.tabBar.items.count * 91, self.categoryScrollView.contentSize.height);//The width of tab bar is set up here
CGRect tabBarFrame= self.tabBar.frame;
tabBarFrame.size.width=self.categoryScrollView.contentSize.width;
self.tabBar.frame=tabBarFrame;
self.tabBar.backgroundImage=[UIImage imageNamed:@"CategoryTabBar"];

图像高度为55.我想知道图像是上升还是下降。我看不到那样做的代码。前景图像和文本的位置是正确的。

这是UITabBar的位置

(lldb) po self.tabBar
<UITabBar: 0x14b2c7f0; frame = (0 0; 1820 55); autoresize = W; layer = <CALayer: 0x14b2b470>>

(lldb) po self.tabBar.superview
<UIScrollView: 0x14b2b050; frame = (0 0; 320 55); clipsToBounds = YES; autoresize = RM+H; gestureRecognizers = <NSArray: 0x14b2b540>; layer = <CALayer: 0x14b2a880>; contentOffset: {0, 0}>

(lldb) po self.tabBar.superview.superview
error: property 'superview' not found on object of type 'id'
error: 1 errors parsing expression
(lldb) po [self.tabBar.superview superview]
<UIScrollView: 0x14b2f1b0; frame = (0 0; 320 55); autoresize = H; gestureRecognizers = <NSArray: 0x14b2f440>; layer = <CALayer: 0x14b2f380>; contentOffset: {0, 0}>

(lldb) po [[self.tabBar.superview superview]superview]
<UIView: 0x14932220; frame = (0 39; 320 55); autoresize = LM+RM+BM; layer = <CALayer: 0x14932280>>

(lldb) po [[self.tabBar.superview superview]superview].backgroundColor
error: no known method '-superview'; cast the message send to the method's return type
error: 1 errors parsing expression
(lldb) po [[[self.tabBar.superview superview]superview] backgroundColor]
UIDeviceRGBColorSpace 0 0 0 0

(lldb) po [[[self.tabBar.superview superview]superview] superview]
<UIView: 0x14933450; frame = (0 0; 320 480); autoresize = RM+BM; layer = <CALayer: 0x149334b0>>

0 个答案:

没有答案