Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/44.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 某个时间未调用行的选择器视图_Iphone_Ios_Objective C_Uipickerview - Fatal编程技术网

Iphone 某个时间未调用行的选择器视图

Iphone 某个时间未调用行的选择器视图,iphone,ios,objective-c,uipickerview,Iphone,Ios,Objective C,Uipickerview,我通过编程将我的选择器视图添加到我的主视图中。如果我点击picker视图,它会点击测试滚动条而不是pickerview,因此我无法从pickerview中选择行 - (void)textFieldDidBeginEditing:(UITextField *)textField { viewForValueForPicker = [[UIView alloc]initWithFrame:CGRectMake(125, txtvisitReason.frame.origin.y+txtvis

我通过编程将我的选择器视图添加到我的主视图中。如果我点击picker视图,它会点击测试滚动条而不是pickerview,因此我无法从pickerview中选择行

- (void)textFieldDidBeginEditing:(UITextField *)textField {
    viewForValueForPicker = [[UIView alloc]initWithFrame:CGRectMake(125, txtvisitReason.frame.origin.y+txtvisitReason.frame.size.height, 180, 160)];
    UIToolbar *toolBar = [[UIToolbar alloc]initWithFrame:CGRectMake(125, 0, 180, 30)];
    toolBar.barStyle = UIBarStyleBlackOpaque;
    UIBarButtonItem *btn = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneBtnPressToGetValue)]autorelease];
    [toolBar setItems:[NSArray arrayWithObject:btn]];
    [viewForValueForPicker addSubview:toolBar];

    pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(125, 30, 180, 140)];
    pickerView.delegate=self;
    pickerView.dataSource=self;
    pickerView.showsSelectionIndicator=YES;
    [viewForValueForPicker addSubview:pickerView];
    [testscroll addSubview:viewForValueForPicker];// test scroll is my scroll view object i added scroll view to main view 
    [txtvisitReason resignFirstResponder];
}

}


我在这里实现了TapSignature委托方法,它显示主视图,甚至当我触摸picker视图时也是如此。如果触摸picker视图,touch.view会显示测试滚动,而我的picker会消失。

我真的被这个问题弄糊涂了。你能澄清一下吗?谢谢你的回复我编辑了我的帖子行视图方法没有被调用你可以设置[testscroll setDelaysContentTouches:YES];属性,它可能会解决您的问题problem@DipenPanchasara它不工作,我想我的选择器视图是在开始编辑方法不在视图中加载这是主要问题
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
   if(touch.view==testscroll){
        viewForValueForPicker.hidden=YES;
        return YES; //If its the main view accept the touch
   }    else
   return NO; //Otherwise(say tableview) don't consume the touch.