2013-10-17 172 views
0

我下载了CNN iOS应用,并且看到了精彩的菜单!创建菜单CNN iOS应用风格

我张贴2屏幕

look at CNN logo

wonderful menu

现在我问我怎么可以创建一个在我的应用程序。我将在iOS和Android上开发,但Android的相同应用程序没有该菜单。

可以在Andorid中创建此菜单吗? 有没有人建议创建?

预先感谢您

回答

0

得到了解决:创建一个视图,listiview,并与背景的照片一个按钮。比看屏幕之外。如果视图为x = 320 y = 300,则在sotryboard元素放置设置中设置y = -300,并将按钮放置在顶部角落。 On按钮动作制作y = +300的2图形对象的动画。就这样。

- (IBAction)makeTheMagicWithButton:(id)sender { 

//at first click y + 300 and view comes in 
//at the 2nd click y - 300 and return back out the screen 
float y; 
[sender setSelected:![sender isSelected]]; 
if ([sender isSelected]) { 
    y = +300; 
    self.buttonImage = [UIImage imageNamed:@"menuICONSreturn.png"]; 

} else { 
    y = -300; 
    self.buttonImage = [UIImage imageNamed:@"menuICONS.png"]; 
} 


//animation move the view 
[UIView transitionWithView:self.view duration:0.5 options:UIViewAnimationOptionAllowAnimatedContent animations:^{[self.magicView setFrame:CGRectOffset(self.magicView.frame, 0, y)];} 
       completion:nil]; 

//animation move button menu 
[UIView transitionWithView:self.view duration:0.5 options:UIViewAnimationOptionAllowAnimatedContent animations:^{[self.magicButton setFrame:CGRectOffset(self.magicButton.frame, 0, y)];} 
       completion:nil]; 
//change icon 
[self.magicButton setBackgroundImage:self.buttonImage forState:UIControlStateNormal]; 
} 

希望这将帮助别人..

before

after