2010-04-13 65 views
8

這可能有點挑剔,但在iPad SplitViewController設置中,有2個視圖。每個視圖都有一個非常小的黑角四捨五入。 (這也可能與iPhone應用程序相同)。iPhoneOS SDK - 從視圖中刪除角落舍入(iPad問題)

這個舍入在下圖中可見。我想要做的是去除黑色圓角,所以UI不會在底部產生這兩個小顛簸。有沒有人這樣做,或知道如何? - 當然可能。

希望有人以前見過這個。

感謝

Image Link Mirror

alt text http://img19.imageshack.us/img19/7297/screenshot20100413at102.png

+0

這是在窗口的底部?它可能實際上是通過剪輯完成的。 – 2010-04-13 23:59:40

回答

13

以下內容添加到您的應用程序代理:

- (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)]; 
    } 
} 
} 

在你的UISplitViewController的DetailViewController補充:

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation 
{ 
[yourAppDelegate performSelector:@selector(fixRoundedSplitViewCorner) withObject:NULL afterDelay:0]; 
} 
+0

是的,這看起來是去!非常感謝。代碼只在我按下MasterViewController中的表格單元時執行,或者我猜想直到DetailViewController被刷新。我已經嘗試從每個viewDidLoad調用fixRoundedSplitViewCorner,但我無法讓它在第一次加載時工作。你可以給最後一塊拼圖嗎? 上面的代碼到目前爲止太棒了! – oberbaum 2010-04-16 12:19:51

+0

您只需要在設備旋轉時調用fixRoundedSplitViewCorner。添加上面發佈的didRotateFromInterfaceOrientation,它也可以用於應用程序啓動。 – abs 2010-04-16 12:29:00

+1

似乎沒有爲我做任何事情(iOS5)。 – raidfive 2012-01-24 22:18:27

1

你可能必須覆蓋在視圖drawRect,並提請您自己動手沒有四捨五入。