Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.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 禁用ipad中的select widget wheel并使用普通的select_Iphone_Ios_Ipad - Fatal编程技术网

Iphone 禁用ipad中的select widget wheel并使用普通的select

Iphone 禁用ipad中的select widget wheel并使用普通的select,iphone,ios,ipad,Iphone,Ios,Ipad,在ipad中,选择标签显示在小部件控制盘的弹出窗口中。我想在ios中使用普通的select标记abd禁用该功能。查看此链接以更好地理解我的意思:。请参阅以下代码,希望它能帮助您…享受代码 -(void)showPicker{ UIToolbar *toolPicker = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; toolPicker.barStyle = UIBarStyleDefault;

在ipad中,选择标签显示在小部件控制盘的弹出窗口中。我想在ios中使用普通的select标记abd禁用该功能。查看此链接以更好地理解我的意思:。

请参阅以下代码,希望它能帮助您…享受代码

   -(void)showPicker{

    UIToolbar *toolPicker = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
    toolPicker.barStyle = UIBarStyleDefault;

    UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:@selector(hidePicker)];

    [toolPicker setItems:[NSArray arrayWithObjects:cancelButton,  nil]];

    pickerCategory = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0, 44.0, 0.0, 0.0)];
    pickerCategory.delegate=self;
    pickerCategory.dataSource=self;
    pickerCategory.showsSelectionIndicator = YES;
    txtCategory.inputView=pickerCategory;
    [pickerCategory addSubview:toolPicker];

    CGRect thePickerFrame = pickerCategory.frame;
    thePickerFrame.origin.y = toolPicker.frame.size.height;
    [pickerCategory setFrame:thePickerFrame];

    UIView *view = [[UIView alloc] init];
    [view addSubview:pickerCategory];
     [view addSubview:toolPicker];

    UIViewController *vc = [[UIViewController alloc] init];
    [vc setView:view];
    [vc setContentSizeForViewInPopover:CGSizeMake(320, 260)];

    popover = [[UIPopoverController alloc] initWithContentViewController:vc];


    [popover presentPopoverFromRect:txtCategory.bounds inView:txtCategory permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];


}
-(IBAction)hidePicker{
    [popover dismissPopoverAnimated:YES];
}

您可以在操作表上显示选择器。。