1

iPad では、select タグがウィジェット ホイールのポップアップに表示されます。通常のselectタグを使用して、iosでその機能を無効にしたい。このリンクをチェックして、私の意味をよりよく理解してください: http://alvinalexander.com/iphone/iphone-ipad-html-select-widget-wheel .

4

1 に答える 1

0

次のコードを参照してください。お役に立てば幸いです...コードをお楽しみください

   -(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];
}
于 2012-11-24T08:03:41.880 に答える