Wie zu vergrößern dynamisch ein UILabel (Etiketten-und Schriftgröße)?

Im arbeitet derzeit an einem iPhone-Projekt. Ich möchte, um es zu vergrößern dynamisch ein UILabel in Objective-C so:

alt-text http://img268.imageshack.us/img268/9683/bildschirmfoto20100323u.png

Wie ist das möglich? Ich dachte, ich muss es mit CoreAnimation, aber ich habe nicht gearbeitet. Hier ist der code, den ich versuchte:

UILabel * fooL = //[…]
fooL.frame = CGRectMake(fooL.frame.origin.x, fooL.frame.origin.y, fooL.frame.size.width, fooL.frame.size.height);   
fooL.font = [UIFont fontWithName:@"Helvetica" size:80];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:0.5];
[UIView setAnimationBeginsFromCurrentState:YES];
fooL.font = [UIFont fontWithName:@"Helvetica" size:144]; //bigger size
fooL.frame = CGRectMake(20 , 44, 728, 167); //bigger frame
[UIView commitAnimations];

Das problem bei diesem code ist, dass es doesn ' T ändern die Schriftgröße dynamisch.

InformationsquelleAutor Flocked | 2010-03-23
Schreibe einen Kommentar