2012-03-30 17 views
2

iPhoneのGoogleマップアプリでは、部分的なカールの移行が行われた後に、buttomのツールバーが表示されます。私のストーリーボードにモーダルセークを部分的にカールさせて設定すると、新しいビューコントローラーはパントビューからツールバーを隠しています。ツールバーを非表示にする部分カールモーダルを設定するにはどうすればよいですか?

Googleマップアプリのように部分的にカールを設定するにはどうすればよいですか?

Google Maps on iPhone Modal in Storyboard

答えて

2

あなたは、おそらくこの1のためのOpenGL ESに行く必要があります。コアアニメーションは、3-Dであっても、レイヤーで作業する能力を公開しますが、すべてのレイヤーは長方形であり、そのまま操作されます。 perspective distortionであっても軸についてflipping of a layerをアニメートできますが、実行するカーブの種類はCore Animation APIを使用して管理できるより複雑です。

イメージを小さなレイヤーのメッシュに分割し、CATransform3Dを使用してこのカーブ効果を作成することができますが、その時点でOpenGL ESを使用して同じ効果を作成することもできます。

3

このコードを試してください。これは役に立ちます。 このコードを尋ねないでください。

QuartzCore.frameworkをインポートする必要があります。

locationMapViewはあなたのMKMapViewcurlViewアニメーション遷移を停止するという考えのためのあなたの第二UIView

- (IBAction)curlButtonPressed:(id)sender { 

    if (isCurlStarted == NO) { 
     [UIView animateWithDuration:1.0 
         animations:^{ 
          CATransition *animation = [CATransition animation]; 
          [animation setDelegate:self]; 
          [animation setDuration:0.7]; 
          [animation setTimingFunction:[CAMediaTimingFunction functionWithName:@"default"]]; 
          animation.type = @"pageCurl"; 
          animation.fillMode = kCAFillModeForwards; 
          animation.endProgress = 0.65; 
          [animation setRemovedOnCompletion:NO]; 
          [locationMapView.layer addAnimation:animation forKey:@"pageCurlAnimation"]; 
          [locationMapView addSubview:curlView]; 
          ;} 
     ];    
     isCurlStarted = YES; 
    }else{ 
     [self curlDownPressed:curlDownButton]; 
    } 

} 

- (IBAction)curlDownPressed:(id)sender { 
    [UIView animateWithDuration:1.0 
        animations:^{ 
         CATransition *animation = [CATransition animation]; 
         [animation setDelegate:self]; 
         [animation setDuration:0.7]; 
         [animation setTimingFunction:[CAMediaTimingFunction functionWithName:@"default"]]; 
         animation.type = @"pageUnCurl"; 
         animation.fillMode = kCAFillModeForwards; 
         animation.startProgress = 0.35; 
         [animation setRemovedOnCompletion:NO]; 
         [locationMapView.layer addAnimation:animation forKey:@"pageUnCurlAnimation"]; 
         [curlView removeFromSuperview]; 

         ;} 
    ]; 
    isCurlStarted = NO; 
} 
+0

+1ですが、pageCurlがプライベートAPIであるとして、この方法は、私はアップルによって証明することができますか?ありますか – voromax

+0

もちろんです。どうしてですか?私のアプリケーションはすでにappstoreにあります:-) –

+0

http://stackoverflow.com/a/14622113/1083859このコードはもっと役立ちます。私はこのコードを最適化し、そこに投稿しました。 –

関連する問題