Jos*_*hua 5 iphone cocoa-touch button uikit uiactionsheet
我正在使用代码:
Run Code Online (Sandbox Code Playgroud){ randomstatus=0; msg=[[NSString alloc]initWithFormat:@"Good job, do you want to continue?"]; UIActionSheet *actionSheet=[[UIActionSheet alloc]initWithTitle:msg delegate:self cancelButtonTitle:@"No" destructiveButtonTitle:@"Yes" otherButtonTitles:nil]; [actionSheet showInView:self.view]; [actionSheet release]; [msg release]; }
我不想更改代码,但我需要"destructiveButton"为绿色而不是红色.这是可能的,还是我需要使用不同的按钮?
不幸的是,没有任何官方提供的方法来自定义 UIActionSheet 按钮。
但是,您可以访问 UIActionSheet 的子视图(这可能会在将来的 iPhone OS 更新中中断),或者添加一个带有覆盖原始破坏性操作按钮的按钮的新视图(这可能会再次中断)。
虽然与更改 UIActionSheet 上按钮的颜色没有直接关系,但上一个问题:iPhone 禁用 UIActionSheet 按钮演示了向 UIActionSheet 添加自定义视图的几种方法。
| 归档时间: |
|
| 查看次数: |
9043 次 |
| 最近记录: |