为什么在分配和初始化一次后添加“Init”时,“取消”按钮的 UIActionSheet 上的按钮样式会发生变化?
如果我使用此代码,它会正确显示:
UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Photo/Camera" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Capture - Camera", @"Upload - Photo Library", nil];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery showInView:self.view];
如果我使用此代码(...init]
添加),它会显示不正确,并且“取消”按钮样式会更改:
UIActionSheet *popupQuery = [[[UIActionSheet alloc] initWithTitle:@"Photo/Camera" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Capture - Camera", @"Upload - Photo Library", nil] init];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery showInView:self.view];