0

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

我发布 2 屏幕

看看 CNN 标志

很棒的菜单

现在我在问如何在我的应用程序中创建它。我将在 iOS 和 Android 中进行开发,但 Android 的相同应用程序没有那个菜单..

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

先感谢您

4

1 回答 1

0

得到的解决方案:使用 listiview 创建一个视图,并使用背景照片创建一个按钮。比把视图移出屏幕。如果视图是 x = 320 y = 300 在 sotryboard 元素位置设置中设置 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];
}

希望它会帮助某人..

前

后

于 2013-10-18T08:21:37.737 回答