/ Published in: Other
Expand |
Embed | Plain Text
1.[Project]--[Edit Project Setting] メニューを選択。 2.プロジェクト設定画面が表示されるので、下の方の、 [GCC 4.2 - Preprocessing] [Preprocessor Macros] という行を探す。 3.[Preprocessor Macros]の行をダブルクリックする。 4.画面左下の[+]ボタンを押す。 5.DEBUG=1 と入力してOKボタンを押す。 ------------------------ UITapGestureRecognizer : タップ(タップの数は任意で取得) UIPinchGestureRecognizer : ピンチインとピンチアウト(拡大縮小用。二本指でくぱぁするアレ) UIPanGestureRecognizer : パニング(ドラッグのこと) UISwipeGestureRecognizer : スワイプ(ページ送りなど。ドラッグと似てる?) UIRotationGestureRecognizer : 回転(指二本での回転) UILongPressGestureRecognizer : 長押し(safariの新規タブを開くときに使うなど) UITapGestureRecognizer *tapRec = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(DetectionDoubleTap:)]; tapRec.numberOfTapsRequired = 2; [self.view addGestureRecognizer:tapRec]; [tapRec release]; - (void)DetectionDoubleTap:(id)sender { NSLog(@"DoubleTap!"); }//!< 画面回転を許可する - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } //!< 画面回転時に呼び出される -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { if(interfaceOrientation == UIInterfaceOrientationPortrait){ NSLog(@"縦(ホームボタン下)"); } else if(interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){ NSLog(@"縦(ホームボタン上)"); } else if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft){ NSLog(@"縦(ホームボタン右)"); } else if(interfaceOrientation == UIInterfaceOrientationLandscapeRight){ NSLog(@"縦(ホームボタン左)"); } } //--------------------------------------------------- //現在の回転方向 int direction = self.interfaceOrientation; //0 : 不明 //1 : 縦(ホームボタン下) //2 : 縦(ホームボタン上) //3 : 横(ホームボタン右) //4 : 横(ホームボタン左) ------------------------ ふつうに、こんな風につかえばいい NSLOG(@"evolveLevel = %d\n", evolveLevel);
You need to login to post a comment.
