change position of cancel button in UIAlertView?

前端 未结 2 1410
星月不相逢
星月不相逢 2021-02-20 01:01

I noticed that when I delete an app from my iPhone home screen, the alert view that appears shows a Delete button on the left and Cancel on the right. However, when I build a de

2条回答
  •  难免孤独
    2021-02-20 01:37

    A possible reason Apple used an alert view on the home screen was because it once asked users to rate the apps they were removing (not anymore). They likely made the Cancel button the lighter-colored one because this was considered a destructive action (deletes an app and its data).

    I guess you could reverse the titles (cancelButtonTitle:@"Delete" otherButtonTitles:@"Cancel", nil) and handle clicks on those buttons the other way around (not sure if Apple did the same). That would be a little awkward though; how about using an action sheet instead?

提交回复
热议问题