在iphone应用程序可以我们设置在UIAlertView中的列数,如同我在UIAlertView中六个按钮我然后如何显示它在2列3行。如果任何一个做了亲切分享它,它会怎么做..

任何示例代码将是额外的帮助

有帮助吗?

解决方案

一个UIAlertView只是一个UIView。所以,你可以在按钮手动添加到UIAlertView在两列配置。有一个例子这里演示添加UITextFields,但我敢肯定,你能适应它。

注意,具有在UIAlertView两个many按钮可能会得到苹果公司的备份; - )

其他提示

我已经做了这样的

NSArray *subViewArray = Topicdialog.subviews;
    float y = 60.0f;

    for(int x=2;x<[subViewArray count];x += 2){

        UIView *button = [subViewArray objectAtIndex:x];

        CGRect frame = button.frame;
        frame.size.width = 120.0f;
        frame.size.height = 42.0f;
        frame.origin.x = 20.0f;
        frame.origin.y = y;
        button.frame = frame;

        UIView *button1 = [subViewArray objectAtIndex:x + 1];

        frame = button1.frame;
        frame.size.width = 120.0f;
        frame.size.height = 42.0f;
        frame.origin.x = 152.0f;
        frame.origin.y = y;
        button1.frame = frame;
        y = y + 48.0f;
    }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top