2010-12-21 157 views
0

我正在展示一个带有一半的屏幕的动画的UIView。我已经看到了很多的应用程序,但无法找到相应的RGB色彩:iPhone PopUp RGB颜色

的iOS使用它,例如在“联系人”:

bottomLayer.backgroundColor = [[UIColor colorWithRed:80.0/255.0 green:86.0/255.0 blue:97.0/255.0 alpha:1] CGColor]; 

http://img98.imageshack.us/img98/9402/image001u.png

我与尝试

但它都是白色的。

如果任何人都可以得到这个弹出是如何设计的?

谢谢!

回答

3

你会想看看UIActionSheet。它会为您创建视图并拥有适当的动画。非常容易使用。

您只需要实施UIActionSheetDelegate委托方法。

@interface MyViewController : UIViewController <UIActionSheetDelegate> 

然后使动作片:

UIActionSheet *choice = [[UIActionSheet alloc] initWithTitle:@"" 
                delegate:self 
              cancelButtonTitle:@"Annuler" 
             destructiveButtonTitle:nil 
              otherButtonTitles:@"Prendre une photo",@"Choisir une photo",nil]; 
[choice showInView:self.view]; 

这将调用:

- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex 

哪个就像UIAlertView中。

+0

+1打我给它。 (然后你加载了更多的细节。):-) – 2010-12-21 15:08:49

+0

@middaparka:我不小心把UIAlertSheet放在第一位。 :)必须先记住我的代码,然后记住正确的名字。感谢+1。 – RyanJM 2010-12-21 15:11:20

+0

谢谢Rayan和middiparka!非常容易使用! – McLas 2010-12-22 14:13:26

3

在Applications/Utilities /应用程序中有一个名为“DigitalColor Meter”的很棒的工具,它可以让你的屏幕上的任何东西都变成RGB。我觉得这非常有帮助。

2

这是标准的UIActionSheet背景。请参阅UIActionSheet Class Reference了解更多信息。顺便提一句,NavBar示例代码(从上面的类引用的相关示例代码部分链接而来)是相当不错的一个示例。

1

如果你要的颜色设置为普通视图,不知为什么白色的那么答案是,你不必CGColor

bottomLayer.backgroundColor = [UIColor colorWithRed:80.0/255.0 green:86.0/255.0 blue:97.0/255.0 alpha:1];