0
如何添加一個標誌,進入到我的當前視圖控制器,A標籤進入從頂部動畫當前視圖在iPhone應用
從頂部動畫;
即
像一個滑塊,它應該在屏幕上,
我想在其上顯示的詳細信息,
我知道 [self.view addSubView:myNewLabel];
但它不做任何動畫,
我需要動畫。
如何添加一個標誌,進入到我的當前視圖控制器,A標籤進入從頂部動畫當前視圖在iPhone應用
從頂部動畫;
即
像一個滑塊,它應該在屏幕上,
我想在其上顯示的詳細信息,
我知道 [self.view addSubView:myNewLabel];
但它不做任何動畫,
我需要動畫。
我想,我得到了答案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];
你也可以製作動畫,而不是將它添加到另一個視圖和動畫的標籤,該標籤。除此之外,你有正確的想法。 – 2009-08-08 06:44:14