ind*_*gie 18 cocoa-touch objective-c ipad uisplitviewcontroller
在iPad上使用UISplitViewController时,在根视图和细节视图之间有一条黑色的垂直分隔线.有没有办法删除这一行?
谢谢
Wil*_* T. 12
@bteapot的优秀答案.我测试了它并且它可以工作,甚至摆脱了主/细节导航条之间的界限.
您可以在storyboard中通过向USplitViewController运行时属性添加"gutterWidth"键路径和值0来执行此操作.
chi*_*iya 10
我有一些修改来回答(迪伦)的回答
在appDelegate中我们需要在spliteview控制器中添加图像而不是窗口
self.splitViewController.view.opaque = NO;
imgView = [[UIImageView alloc] initWithImage:
[UIImage imageNamed:@"FullNavBar.png"]];
[imgView setFrame:CGRectMake(0, 0, 1024, 44)];
[[self.splitViewController view] insertSubview:imgView atIndex:0];
[[self.splitViewController view] setBackgroundColor:[UIColor clearColor]];
Run Code Online (Sandbox Code Playgroud)
这里自我是AppDelegate的对象.
现在应用此主题的答案:iPhoneOS SDK - 从视图中删除角落舍入(iPad问题)回答(abs)
编辑上面的帖子的答案是
-(void) fixRoundedSplitViewCorner {
[self explode:[[UIApplication sharedApplication] keyWindow] level:0];
}
-(void) explode:(id)aView level:(int)level
{
if ([aView isKindOfClass:[UIImageView class]]) {
UIImageView* roundedCornerImage = (UIImageView*)aView;
roundedCornerImage.hidden = YES;
}
if (level < 2) {
for (UIView *subview in [aView subviews]) {
[self explode:subview level:(level + 1)];
}
}
imgView.hidden = FALSE;
}
Run Code Online (Sandbox Code Playgroud)
**使imgView.hidden为FALSE将imgView声明为AppDelegate.h文件**
别忘了叫这个
-(void)didRotateFromInterfaceOrientation:
UIInterfaceOrientation)fromInterfaceOrientation
{
[yourAppDelegate performSelector:@selector(fixRoundedSplitViewCorner)
withObject:NULL afterDelay:0];
}
Run Code Online (Sandbox Code Playgroud)
chintan adatiya回答仅涵盖了角落和导航栏,但我发现了如何覆盖Master和Detail视图之间的界限.
这不是很好,但它的作用就像一个魅力.
首先创建一个宽1 px,高704像素的图像.
在didFinishLaunchingWithOptions中添加以下代码:
UIView *coverView = [[UIView alloc] initWithFrame:CGRectMake(320, 44, 1, 704)];
[coverView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"divider_cover.png"]]];
[splitViewController.view addSubview:coverView];
Run Code Online (Sandbox Code Playgroud)并做了.
当你想要一个继续创建3个图像的背景图像时:
小智 5
首先发帖,大家好.
我发现了如何意外地做到这一点...当我试图找到为什么我失去了分隔线.如果您仍然感兴趣,可以使用以下隐藏方法:
1)在Detail(右侧)视图中,确保您有一个跨越整个视图的子视图.
2)将此子视图视图偏移到(-1,0).
3)确保未选中详细信息视图的"剪辑子视图"选项.
Voilà,享受.
| 归档时间: |
|
| 查看次数: |
12657 次 |
| 最近记录: |