2010-03-18 14 views

Antwort

15

Fügen Sie den UIActivityIndicatorView als Subview der Taste:

// Create spinner 
UIActivityIndicatorView *myIndicator = [[UIActivityIndicatorView alloc] 
    initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; 

// Position the spinner 
[myIndicator setCenter:CGPointMake(myButton.frame.size.width/2, myButton.frame.size.height/2)]; 

// Add to button 
[myButton addSubview:myIndicator]; 

// Start the animation 
[myIndicator startAnimating]; 
+0

Dank. Ja, es funktioniert. Wie ändere ich die Position des Indikators? Jetzt lädt es oben links von der Schaltfläche. – Pugal

+0

Siehe aktualisierte Antwort – pheelicks

+1

Danke, es funktioniert gut. – Pugal