开发者

UIAlert button size

Is there a way to specify the size of a UIAlert b开发者_StackOverflow中文版utton?

Is there a way to specify the layout of buttons on UIAlert? Like having three buttons next to each other and a cancel button on the buttom?


Is there a way to specify the size of a UIAlert button?

No easy way. The buttons must fill the whole dialog horizontally unless you heavily override its internal -layout method, or mess with the frames of the UIAlert's subview after it's shown.

Is there a way to specify the layout of buttons on UIAlert? Like having three buttons next to each other and a cancel button on the buttom?

There used to be an int numberOfRows property to specify how the buttons distribute, but this is now ignored for UIAlertView.


You can add a subview with any buttons you'd like to the UIAlertView and grow its height to match. It is difficult to get it to lay out properly if you use any standard alert buttons, titles, or messages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜