iPhoneOS SDK - Remove Corner Rounding from views (iPad problem)

后端 未结 2 1972
孤独总比滥情好
孤独总比滥情好 2020-12-16 22:27

This might be a little bit picky, but in the iPad SplitViewController setup, there are 2 views. Each of the views has a very small black corner rounding. (This is probably t

相关标签:
2条回答
  • 2020-12-16 23:15

    Add the following to your app delegate:

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

    In your DetailViewController of the UISplitViewController add:

    - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
    {
     [yourAppDelegate performSelector:@selector(fixRoundedSplitViewCorner) withObject:NULL afterDelay:0];
    }
    
    0 讨论(0)
  • 2020-12-16 23:20

    You'll probably have to override drawRect in the view and draw your it yourself without the rounding.

    0 讨论(0)
提交回复
热议问题