2009-08-08 24 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

相關問題