0
- (void)viewDidLoad {
checkingOption = [[UIView alloc] initWithFrame:CGRectMake(45, 250, 17, 15)];
checkingOption.backgroundColor = [UIColor grayColor];
checkingOption.layer.cornerRadius = 5;
checkingOption.layer.masksToBounds = YES;
checkingOption.opaque = NO;
[self.view addSubview:checkingOption];
[checkingOption setUserInteractionEnabled:YES];
}
view.now我想測試這是我對主要的新的用戶觸摸上或不...的UIView沒有采取觸摸
-(void)touchesBegan: (NSSet *)touches withEvent:(UIEvent *)event{
[self.usernameField resignFirstResponder];
[self.passwordField resignFirstResponder];
UITouch *touch =[touches anyObject];
CGPoint startPoint =[touch locationInView:checkingOption];
if(CGRectContainsPoint(checkingOption.frame,startPoint)){
NSLog(@"touch inside the checking view");
}
請幫助me..i我不是發現問題。
在此先感謝。
其實我也讓你point..how可以檢查我的新觀點??? ...如果它是一個stupidious問題,請然後再也mind.i沒有在'UITapGestureRecognizer'上工作。 – Emon
感謝沒有必要幫助更多我已經解決了它......其實我只需要設置'UITouch * touch = [[event allTouches] anyObject]; \t CGPoint startPoint = [touch locationInView:checkingOption];如果(CGRectContainsPoint(checkingOption.bounds,startPoint)){ \t \t NSLog(@「在檢查視圖內觸摸」); \t}' – Emon