创建菜单CNN iOS应用程序样式

时间:2013-10-17 06:53:39

标签: android ios menu

我下载了CNN iOS应用程序,我看到了很棒的菜单!

我发布了2个屏幕

look at CNN logo

wonderful menu

现在我问我怎样才能在我的应用程序中创建它。我将在iOS和Android中开发,但Android的相同应用程序没有该菜单..

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

提前谢谢

1 个答案:

答案 0 :(得分:0)

获得解决方案:使用listiview创建一个视图,使用背景照片创建一个按钮。比从屏幕上看。如果视图是x = 320 y = 300,则在sotryboard element postition设置中设置y = -300,并将按钮放在顶角。 在按钮动作上,制作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

相关问题