2013-10-17 89 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