2012年3月27日火曜日

iphoneアプリ開発メモ2

タップのイベントを取る時に、View上でイベントを取る場合は
ロード時にイベントと関数を結びつける設定をしていたが、

scrollview上で
下記関数をオーバーライドしても実装できる。
・タッチ開始
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

・タッチ終了
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

・タッチしてスライド
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

・タッチが中断した場合
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event

※オーバーライドしたcustomImageVeiwクラスを作成する。
 作成したあと、customImageViewを使うようにクラスを差し替える。

下記ブログが参考になるので参照
http://d.hatena.ne.jp/touka_tt/20110404/1301893982

http://cocoadays.blogspot.jp/2010/09/3.html

デリゲートに関する記事
http://ai-lab.biz/blog/development/entry-341.html

今日やる事。
scrollview上でシングルタップと、ダブルタップのイベントを取る。

0 件のコメント:

コメントを投稿