Untersicht slide in animation, iphone
Ich habe eine UIview Mit zwei UIButtons.
-(void)ViewDidLoad
{
geopointView = [[UIView alloc] initWithFrame:CGRectMake(0, 350, 120, 80)];
geopointView.backgroundColor = [UIColor greenColor];
UIButton *showGeoPointButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
showGeoPointButton.frame = CGRectMake(0, 0, 120, 40);
showGeoPointButton.titleLabel.font = [UIFont systemFontOfSize:13.0];
[showGeoPointButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[showGeoPointButton addTarget:self action:@selector(showPlaces:) forControlEvents:UIControlEventTouchUpInside];
UIButton *SaveButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]
SaveButton.frame = CGRectMake(0, 40, 120, 40);
SaveButton.titleLabel.font = [UIFont systemFontOfSize: 15.0];
[SaveButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[SaveButton addTarget:self action:@selector(savePlacePopUp) forControlEvents:UIControlEventTouchUpInside];
[geopointView addSubview:showGeoPointButton];
[geopointView addSubview:SaveButton];
}
Möchte ich animieren, um die Folie in der UIview, wenn folgende Methode aufgerufen wird.
-(void) showAnimation
Habe ich versucht, es zu tun, indem Sie folgenden Weg, aber ich sehe keine animation. Wie kann ich es tun?
-(void) showAnimation{
[UIView animateWithDuration:10.0 animations:^{
[self.view addSubview:geopointView];
}];
}
Thannks für jede Hilfe im Voraus.
InformationsquelleAutor der Frage alekhine | 2011-09-08
Du musst angemeldet sein, um einen Kommentar abzugeben.
Müssen Sie die Untersicht mit einem frame-Wert, bei dem die animation beginnen aus (off-screen?) dann ändern Sie den frame-Wert im inneren der animation-block. Der Rahmen wird sich ändern während der Laufzeit, wodurch das auftreten von Bewegung. Der Blick muss bereits eine Untersicht - ich glaube nicht, dass das hinzufügen einer Untersicht ist etwas, was Sie animieren können, macht es keinen Sinn.
InformationsquelleAutor der Antwort Adam Eberbach