你可以試試我的應用程序,如果你想這是2個促銷代碼的時間繪製一個圓點形狀的動作: JMYMRWL4AXX7 4ATFK6XWAWXL你如何讓你每次點擊
http://itunes.apple.com/us/app/ianamnesi/id426778210?mt=8
我想提高它用,所以基本上我希望能夠與在UIImageView的手指上滾動視圖
我需要的,每次我在我的UIImageView點擊時間繪製一個圓點形狀的動作做簽名
-(IBAction)drawdot:(id)sender{}
感謝
我走到這一步:
基本上我有它,在我加入的UIImageView滾動視圖的底部的一些按鈕滾動型,是我想用手指寫。 由於scrolView是困難的,所以我不得不添加UILongPressureGesturesRecongnizer:
- (void)viewDidLoad {
[scrollView setScrollEnabled:YES];
[scrollView setContentSize:CGSizeMake(320,1540)];
scrollView.clipsToBounds = YES;
scrollView.userInteractionEnabled = YES;
scrollView.delaysContentTouches = YES;
scrollView.canCancelContentTouches = NO;
UILongPressGestureRecognizer *gestureRec = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)];
((UILongPressGestureRecognizer*)gestureRec).minimumPressDuration = 0.5;
((UILongPressGestureRecognizer*)gestureRec).numberOfTouchesRequired = 1;
((UILongPressGestureRecognizer*)gestureRec).allowableMovement = NO;
[drawImage addGestureRecognizer:gestureRec];
[gestureRec release];
[super viewDidLoad];
mouseMoved = 0;
mouseSwiped = YES;
if ([MFMailComposeViewController canSendMail])
button.enabled = YES;
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn addTarget:self action:@selector(printItem) forControlEvents:UIControlEventTouchDown];
btn.frame = CGRectMake(75, 0, 44, 44);
[BTN setImage:[UIImage的imageNamed:@ 「print.png」] forState:UIControlStateNormal]; [self.view addSubview:btn];
}
現在我的UIImageView識別長觸摸,所以當我觸摸0.5秒就做出這個動作:
- (void)imageTapped:(UITapGestureRecognizer *)sender
{
UIView *theSuperview = self.view; // whatever view contains your image views
CGPoint touchPointInSuperview = [sender locationInView:theSuperview];
UIView *touchedView = [theSuperview hitTest:touchPointInSuperview withEvent:nil];
if([touchedView isKindOfClass:[drawImage class]])
{
// action for making a dot
}
}
現在我必須包括一些讓點當我點擊,並且因爲長時間按住GandureRecognize,當我移動手指時,它將它識別爲多個水龍頭。
謝謝
在圖像視圖中點擊位置繪製一個點? – 2011-05-22 13:39:00
如果你能分享它,我需要一些代碼。 – Marco 2011-05-22 14:11:53