
这是我正在使用的代码:
UIDatePicker *datePickerVIEw = [[UIDatePicker alloc] init]; datePickerVIEw.datePickerMode = UIDatePickerModeDate; self.dateActionSheet = [[UIActionSheet alloc] initWithTitle:@"Choose a Follow-up Date" delegate:self cancelbuttonTitle:nil destructivebuttonTitle:nil otherbuttonTitles:@"Done",nil]; [self.dateActionSheet showInVIEw:self.vIEw]; [self.dateActionSheet addSubvIEw:datePickerVIEw]; [self.dateActionSheet sendSubvIEwToBack:datePickerVIEw]; [self.dateActionSheet setBounds:CGRectMake(0,320,500)]; CGRect pickerRect = datePickerVIEw.bounds; pickerRect.origin.y = -95; datePickerVIEw.bounds = pickerRect;解决方法 我最终为iPad Popover创建了一个单独的代码段:
//build our custom popover vIEwUIVIEwController* popoverContent = [[UIVIEwController alloc] init];UIVIEw* popoverVIEw = [[UIVIEw alloc] initWithFrame:CGRectMake(0,344)];popoverVIEw.backgroundcolor = [UIcolor whitecolor];datePicker.frame = CGRectMake(0,44,300);[popoverVIEw addSubvIEw:toolbar];[popoverVIEw addSubvIEw:datePicker];popoverContent.vIEw = popoverVIEw;//resize the popover vIEw shown//in the current vIEw to the vIEw's sizepopoverContent.contentSizeforVIEwInPopover = CGSizeMake(320,244);//create a popover controllerUIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentVIEwController:popoverContent];//present the popover vIEw non-modal with a//refrence to the button pressed within the current vIEw[popoverController presentPopoverFrombarbuttonItem:self.navigationItem.leftbarbuttonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];//release the popover content[popoverVIEw release];[popoverContent release];总结
以上是内存溢出为你收集整理的iphone – UIDatePicker在UIActionSheet在iPad上全部内容,希望文章能够帮你解决iphone – UIDatePicker在UIActionSheet在iPad上所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)