2012-06-25 29 views

回答

0

不,昏暗总是与α,做你需要什么,你将不得不实现自己的模式过渡板

+0

谢谢。耻辱,我希望有一个轻松的生活... –

0

您可以对图片做:

- (void)willPresentActionSheet:(UIActionSheet *)actionSheet { 
    UIImage *backgroundImage = [UIImage imageNamed:@"testimage.png"];  
    backgroundImage = [backgroundImage stretchableImageWithLeftCapWidth:20 topCapHeight:40]; 
    CGSize theSize = actionSheet.frame.size; 
    // draw the background image and replace layer content 
    UIGraphicsBeginImageContext(theSize);  
    [theImage drawInRect:CGRectMake(0, 0, theSize.width, theSize.height)];  
    theImage = UIGraphicsGetImageFromCurrentImageContext();  
    UIGraphicsEndImageContext(); 
    [[actionSheet layer] setContents:(id)backgroundImage.CGImage]; 
} 

或者做这种方式:

CGSize mySize = myActionSheet.bounds.size; 
CGRect myRect = CGRectMake(0, 0, mySize.x, mySize.y); 
UIImageView *blackView = [[[UIImageView alloc] initWithFrame:myRect] autorelease]; 
[redView setBackgroundColor:[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]]; 
[self.view insertSubview:blackView atIndex:0]; 

您还可以更改actionSheetStyle

MyActionSheet.actionSheetStyle=UIActionSheetStyleBlackOpaque; 
MyActionSheet.actionSheetStyle=UIActionSheetStyleBlackTranslucent; 
+0

谢谢。有没有一种方法可以使用iPad中的模式视图控制器以表格样式进行操作? –

0

考虑到似乎没有一个漂亮的解决方案,可以通过在prepaForSegue()中的presentationViewController顶部插入带有黑色背景的子视图来完成简单的破解。然后就在解散表单之前,先获取presentationViewController(self.presentingViewController)并删除添加的视图。

相关问题