Pregunta

En la aplicación iPhone podemos establecer el número de columnas en UIAlertView como si tuviera seis botones en UIAlertView entonces ¿cómo puedo mostrarlo en 2 columnas y 3 filas. Si alguno lo ha hecho la amabilidad de compartirlo cómo se va a hacer ..

Cualquier código de muestra será de ayuda adicional

¿Fue útil?

Solución

A UIAlertView es sólo un UIView. Así que usted puede agregar manualmente los botones a la UIAlertView en una configuración de dos columnas. Hay un ejemplo aquí que muestra el agregado UITextFields, pero estoy seguro de que puede adaptarse a él.

Tenga en cuenta que muchos tienen dos botones en la UIAlertView podría volver de Apple arriba; -)

Otros consejos

Lo he hecho como éste

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;
    }
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top