コードごとに、すべての可能性を試しましたが、シーケンスを変更できないように、アラートアクションボタンのシーケンスを変更したいと思います。 HIG 1としてUIalertcontrollerボタンのシーケンス
である。この結果、以下の私を与えるだろう、ここで
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"alert" message:@"My alert message" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* noButton = [UIAlertAction
actionWithTitle:@"Cancel"
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action)
{
[alertController dismissViewControllerAnimated:YES completion:nil];
}];
UIAlertAction* yesButton = [UIAlertAction
actionWithTitle:@"OK"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
[alertController dismissViewControllerAnimated:YES completion:nil];
}];
[alertController addAction:yesButton];
[alertController addAction:noButton];
[self presentViewController:alertController animated:YES completion:nil];
を自分のコードを参照してください。私は右手でキャンセルbutton
を変更し、左側でOK button
を変更したいと思います。
私はあなたの時間を感謝しています。
キャンセルボタンは、他のオプションが破壊的なアクションである場合にのみ、そのアクションに 'UIAlertActionStyleDestructive'を使用する必要があります。それを左に置くことは、右側が 'UIAlertActionStyleDefault'のときの正しい振る舞いです。 – dan