2009-08-08 37 views

回答

1

我想,我得到了答案r & d。

转到您的视图控制器,

得到viewDidLoad方法

添加以下代码,

UIView *aNewView; 
aNewView=[[UIView alloc] initWithFrame:CGRectMake(0, -90, 320, 90)]; 
[aNewView setBackgroundColor:[UIColor brownColor]]; 
[aNewView setAlpha:0.87]; 

    UILabel *titleLabel; 
titleLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 25, 280, 30)]; 
titleLabel.font=[UIFont systemFontOfSize:15]; 
[email protected]"SRK - Sagar R Kothari"; 
titleLabel.textColor=[UIColor whiteColor]; 
titleLabel.backgroundColor=[UIColor clearColor]; 
[aNewView addSubview:titleLabel]; 

CGRect frame = aNewView.frame; 
[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:.75]; 

frame.origin.y = 90; 
frame.origin.x = 0; 
frame.size.height=400; 
self.view.frame = frame; 

[UIView commitAnimations]; 


[self.view addSubview:aNewView]; 
+1

你也可以制作动画,而不是将它添加到另一个视图和动画的标签,该标签。除此之外,你有正确的想法。 – 2009-08-08 06:44:14

相关问题