UIAlertView

  • UIAlertView

    Ich bin es schon wieder.

    Ich verwende folgenden Quellcode für eine UIAlertView:

    PHP-Quellcode

    1. UIAlertView *myAlert = [[UIAlertView alloc]
    2. initWithTitle: @"Login"
    3. message:@""
    4. delegate:self
    5. cancelButtonTitle:@"Abbrechen"
    6. otherButtonTitles:@"Login", nil];
    7. // Texteingabefelder hinzufügen
    8. [myAlert addTextFieldWithValue:@"" label:@"Benutzername"];
    9. [myAlert addTextFieldWithValue:@"" label:@"Passwort"];
    10. // Texteingabefelder konfigurieren
    11. UITextField *textfield = [myAlert textFieldAtIndex:0];
    12. textfield.clearButtonMode = UITextFieldViewModeWhileEditing;
    13. textfield.keyboardType = UIKeyboardTypeAlphabet;
    14. textfield.keyboardAppearance = UIKeyboardAppearanceAlert;
    15. textfield.autocapitalizationType = UITextAutocapitalizationTypeWords;
    16. textfield.autocorrectionType = UITextAutocorrectionTypeNo;
    17. textfield = [myAlert textFieldAtIndex:1];
    18. textfield.clearButtonMode = UITextFieldViewModeWhileEditing;
    19. textfield.keyboardType = UIKeyboardTypeURL;
    20. textfield.keyboardAppearance = UIKeyboardAppearanceAlert;
    21. textfield.autocapitalizationType = UITextAutocapitalizationTypeNone;
    22. textfield.autocorrectionType = UITextAutocorrectionTypeNo;
    23. [myAlert show];
    24. [myAlert release];
    Alles anzeigen



    Gefunden habe ich das so im Netz mobile-dev.de/iphone-code-schn…t-texteingabefeldern.html

    Jetzt ist die Frage ob das
    A) so okay ist und von Apple akzeptiert wird
    und
    B) wie kann ich auf meine Textfelder zugreifen, da ich ja Benutzername und Passwort überprüfen will.


    Schon mal Danke.

    Gruß
    Cabaalo
  • Wiso nehmen da eigentlich alle Alertviews für ? Mach doch einfach ein ganz normales view das einfach transparenten Hintergrund hat und legst in der Mitte ein Bild drauf das wie ein Alert aussieht und fertig. Da kannste dann reinbauen was immer du lsutig bist

    Gruß

    Claus
    2 Stunden Try & Error erspart 10 Minuten Handbuchlesen.

    Pre-Kaffee-Posts sind mit Vorsicht zu geniessen :)