2012-02-22 6 views

答えて

5

方法1:

あなたのUIImageViewが位置するUIButtonを置くことができます。カスタムタイプにUIButtonを設定し、touchupinsideにIBActionを設定します。

方法2:あなたは何ができるか

UIButtonに背景画像を設定するタイプカスタムのそれを作るとtouchupinsideIBActionに設定されています。この方法では、ペン先にUIImageViewを置く必要はありません。画面を見てください。

enter image description here

2

ビューのユーザーインタラクションを正しく設定できます。 次のタッチイベントを使用してタッチを見つけ、次のビューを押します。

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    UITouch *touch= [touches anyObject]; 
    if ([touch view] == your_ImageViewName) 
    { 
      write your code here to push the view.. 
    } 
} 
4
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ 
UITouch *touch = [[event allTouches] anyObject]; 
if ([touch view] == image) { 

    // image touches 
    // write code here for go to another view 
} 
else if ([touch view] == image1) { 

    // image1 touches 
    // write code here for go to another view 
} 
} 
関連する問題