2012-01-12 15 views
1

私はmapviewを持っており、ボタンを押したときにtabbarcontrollers flipのようなmapviewのフリップで別のビューを表示したい。ボタンはmapviewの下に置かれます(これは80%の残りの20%ボタンを占有します)。次に、ボタンを反転することなくmapviewだけを反転させる方法。地図を反転するボタンを押したときに表示されるiPhoneで押された?

ありがとうございます...

答えて

4

これには次の方法を使用できます。問題が見つかった場合は、私に知らせてください。

  1. は追加適切flipContainerView、MapViewのとanotherViewの
  2. セットフレームをself.viewするflipContainerView(とないanotherView)とflipContainerViewへのMapViewをMapViewのかanotherView
  3. のいずれかが含まれますUIViewのflipContainerViewを定義します。 mapViewとanotherViewは同じフレームを持ちます。
 
    -(void) MapOranotherView 
    { 
     [UIView beginAnimations:nil context:NULL]; 
     [UIView setAnimationDuration:1.0]; 
     [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:flipContainerView cache:YES]; 
     if ([mapView superview]) 
     { 

      [mapView removeFromSuperview]; 
      [flipContainerView addSubview:anotherView]; 
      [flipContainerView sendSubviewToBack:anotherView]; 
     } 
     else 
     { 

      [anotherView removeFromSuperview]; 
      [flipContainerView addSubview:mapView]; 
      [flipContainerView sendSubviewToBack:mapView]; 
     } 
     [UIView commitAnimations]; 
    } 
のMapViewとanotherView間を反転するために呼び出す、次の方法
関連する問題