2009-12-07 6 views
1

Dans l'application iphone, pouvons-nous définir le nombre de colonnes dans UIAlertView comme si j'avais six boutons dans UIAlertView alors comment puis-je l'afficher dans 2 colonnes et 3 lignes. Si quelqu'un fait il bien vouloir partager ce comment il fait ..Colonnes UIAlertview Button

Tout exemple de code sera une aide supplémentaire

Répondre

0

A UIAlertView est juste un UIView. Vous pouvez donc ajouter manuellement les boutons au UIAlertView dans une configuration à deux colonnes. Il y a un exemple here qui montre l'ajout de UITextField s, mais je suis sûr que vous pouvez l'adapter.

Notez que ayant deux nombreux boutons dans la UIAlertView pourrait obtenir Apple back up ;-)

0

Je l'ai fait comme ça

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; 
    } 
+0

est-il une bonne façon de boutons UIAlertView alight selon application soumission magasin politique ... tout avis ou idée sera apprécié – luckee