ale*_*lex 2 iphone objective-c
我尝试更改动作表的背景颜色,我只是使用方法:
[actionSheet setBackgroundColor:[UIColor colorWithRed:30 green:30 blue:30 alpha:0.5]];
我把它放在willPresentActionSheet中.但背景颜色不变,为什么?
ale*_*evn 12
#import "QuartzCore/QuartzCore.h"
...
yourActionSheet.delegate = self;
yourActionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
...
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
[[actionSheet layer] setBackgroundColor:[UIColor redColor].CGColor];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12121 次 |
| 最近记录: |