如何将目标视图放在选项卡栏的顶部?
How can I place my target view on top of the tab bar?
我想将 targetView 放在 标签栏 的正上方。我用 targetLabel 和 cancelButton.
创建了一个 XIB-File
我试图以编程方式将我的 targetView 放置在我的 选项卡栏 之上,但我不知道如何在没有 space 的情况下做到这一点他们。
[self addOverlayView:self.targetView x:0 y:self.view.frame.size.height - self.targetView.frame.size.height - 10];
addOverview 是我用来放置视图的函数:
- (void)addOverlayView:(UIView*)v x:(CGFloat)x y:(CGFloat)y
{
v.hidden = YES;
CGRect vFrame = v.frame;
vFrame.origin.x = x;
vFrame.origin.y = y;
if ((v.autoresizingMask & UIViewAutoresizingFlexibleWidth) != 0) {
vFrame.size.width = topView.bounds.size.width;
}
v.frame = vFrame;
[v.layer setTransform:CATransform3DMakeTranslation(0, 0, OVERLAY_TRANSLATION_Z)];
[overlayView addSubview:v];
}
我不知道这是否是正确的方法,但它对我有用(到目前为止)。
我需要更改哪些内容才能使我的 targetView 位于我的 [=26 之上=]tabBar?
删除 -10 并检查
[self addOverlayView:self.targetView x:0 y:self.view.frame.size.height - self.targetView.frame.size.height];
我想将 targetView 放在 标签栏 的正上方。我用 targetLabel 和 cancelButton.
创建了一个 XIB-File我试图以编程方式将我的 targetView 放置在我的 选项卡栏 之上,但我不知道如何在没有 space 的情况下做到这一点他们。
[self addOverlayView:self.targetView x:0 y:self.view.frame.size.height - self.targetView.frame.size.height - 10];
addOverview 是我用来放置视图的函数:
- (void)addOverlayView:(UIView*)v x:(CGFloat)x y:(CGFloat)y
{
v.hidden = YES;
CGRect vFrame = v.frame;
vFrame.origin.x = x;
vFrame.origin.y = y;
if ((v.autoresizingMask & UIViewAutoresizingFlexibleWidth) != 0) {
vFrame.size.width = topView.bounds.size.width;
}
v.frame = vFrame;
[v.layer setTransform:CATransform3DMakeTranslation(0, 0, OVERLAY_TRANSLATION_Z)];
[overlayView addSubview:v];
}
我不知道这是否是正确的方法,但它对我有用(到目前为止)。
我需要更改哪些内容才能使我的 targetView 位于我的 [=26 之上=]tabBar?
删除 -10 并检查
[self addOverlayView:self.targetView x:0 y:self.view.frame.size.height - self.targetView.frame.size.height];