如何在单色iPhone中创建折叠地图,就像在iPhone的地图应用程序中一样

时间:2013-03-17 11:48:52

标签: iphone xcode xamarin.ios mkmapview

这是iPhone地图应用程序的屏幕截图:

enter image description here

我们如何在我们的应用程序中实现这样的页面。我是iphone和monotouch的新手,不知道这是否是可以在MKMapView上提供折叠或功能的组件?或许这是一个自定义代码! 任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

使用此代码段,它将完成这项工作。

[UIView transitionWithView:urImage 
    duration:1.5 
    options: UIViewAnimationOptionTransitionCurlUp 
    animations^{
        urImage.frame = requiredFrame;
    } 
    completion:^(BOOL finished){
        //[urImage removeFromSuperview];
        // do something after animation has completed
    }
   ];

您可以随意使用它并将其插入所需的位置。

她是uiview动画的苹果文档的链接:

http://developer.apple.com/library/ios/ipad/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html

编辑:

这里有一组代码可以提供相同的效果:只需正确连接不作为。它只使用几个按钮来卷曲和卷曲,所以你应该能够做到这一点。只需创建一个视图应用程序并在视图中放置两个按钮,然后将操作连接到右侧按钮即可。:)

<。p。文件的代码:

@interface FirstViewController : UIViewController {

IBOutlet UIView *viewSecond;
IBOutlet UIView *viewFirst;   
}

- (IBAction)btnSecondView_Clicked:(id)sender;
- (IBAction)btnFirstView_Clicked:(id)sender;

@end
<。pm文件的代码:

 #import "FirstViewController.h"

@implementation FirstViewController

- (void)viewDidLoad {
[super viewDidLoad];
}

- (void)btnSecondView_Clicked:(id)sender {

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:2.0];
[viewSecond setAlpha:0.0];
[viewFirst setAlpha:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:viewSecond cache:YES];
[UIView commitAnimations];   
}

- (IBAction)btnFirstView_Clicked:(id)sender {

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:2.0];
[viewFirst setAlpha:0.0];   
[viewSecond setAlpha:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:viewFirst cache:YES];
[UIView commitAnimations];
}

- (void)didReceiveMemoryWarning {

[super didReceiveMemoryWarning];

}


- (void)dealloc {
[super dealloc];
}


@end

希望这有助于您开展业务。

快乐的编码。:)