Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.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 pickerview对右侧的单击没有响应_Iphone_Uipickerview - Fatal编程技术网

Iphone pickerview对右侧的单击没有响应

Iphone pickerview对右侧的单击没有响应,iphone,uipickerview,Iphone,Uipickerview,我有一个位于文本字段begin editing method而不是viewdidload中的选择器视图。如果单击或滚动右侧,则不会调用row方法的选择器视图 - (void)textFieldDidBeginEditing:(UITextField *)textField { viewForValueForPicker = [[UIView alloc]initWithFrame:CGRectMake(60, txtvisitReason.frame.origin.y+tx

我有一个位于文本字段begin editing method而不是viewdidload中的选择器视图。如果单击或滚动右侧,则不会调用row方法的选择器视图

    - (void)textFieldDidBeginEditing:(UITextField *)textField {
       viewForValueForPicker = [[UIView alloc]initWithFrame:CGRectMake(60, txtvisitReason.frame.origin.y+txtvisitReason.frame.size.height, 180, 160)];
        UIToolbar *toolBar = [[UIToolbar alloc]initWithFrame:CGRectMake(60, 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] init];
        pickerView.frame=CGRectMake(60, 30, 180, 140);
        pickerView.delegate=self;
        pickerView.dataSource=self;
        pickerView.showsSelectionIndicator=YES;
        [viewForValueForPicker addSubview:pickerView];
        [testscroll addSubview:viewForValueForPicker];

        [txtvisitReason resignFirstResponder];
        }
为了了解我的问题,我采用了这样的手势识别方法

   - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
 {
if(touch.view==testscroll)//just checking my touch here
{

}
}
现在,如果单击左侧,我的触摸屏是“表格视图单元格内容视图”,右侧是“uiscrollview”,而不是“表格视图单元格内容视图”。如果我在此时滚动,我的总视图将滚动,而不是picker视图元素。
我没有任何想法。我的应用程序中的每个地方都在发生。请给我一个想法。提前感谢。

请尝试在至少translate.google.com中更正您的问题,并突出显示您使用撇号的方法,以使其更准确understandable@Ossir如果要使用picker视图作为输入源,通常的做法是使用
inputView
属性(对于
UITextField
)的
UIPickerView
)和
inputAccessoryView
(作为自定义按钮的工具栏)。但是如果您想以其他方式使用它,您应该提供更详细的问题。我想您没有收到我的问题。我的行选择器视图有时没有调用。