在UIAlertView中向下移动按钮 [英] Move buttons down in UIAlertView

查看:48
本文介绍了在UIAlertView中向下移动按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个以横向模式显示的应用程序,并且用以下代码覆盖了 UIAlertView 的高度:

I have an app which displays in landscape mode and I've overwritten the height of a UIAlertView with the following code:

- (void) willPresentAlertView:(UIAlertView *)alertView
{
    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    CGRect frame = [alertView frame];
    alertView.frame = CGRectMake(frame.origin.x, 0, frame.size.width, screenBounds.size.width);
}

这几乎可行. UIAlertView 较高,但是alertview中的按钮不会被按下.

This almost works. The UIAlertView is taller, however, the buttons in the alertview don't get pushed down.

有人知道当我更改警报视图的高度时如何按下 UIAlertView 中的按钮吗?

Does anyone know how I can push the buttons in a UIAlertView down when I change the alert view's height?

推荐答案

我认为用一些独立的AlertView代替UIAlertView而不是搞乱UIAlertView更加优雅,风险也较小.br> TSAlertView 就是这样的替代.

I think it is more elegant and less risky to replace UIAlertView with some independent AlertView instead of messing around with it.With independent I mean not inheriting form UIAlertView.
TSAlertView is such a replacement.

http://dl.dropbox.com/u/47535/TSAlertView/1-thumb.png http://dl.dropbox.com/u/47535/TSAlertView/3-thumb.png http://dl.dropbox.com/u/47535/TSAlertView/2-thumb.png

这篇关于在UIAlertView中向下移动按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆