Displaying a UIDatePicker inside of a UIPopover

前端 未结 2 624
你的背包
你的背包 2021-01-03 06:58

I\'m using the following code to display a UIDatePicker within a UIPopover that is displayed when a user clicks a UIButton.

Th

2条回答
  •  感情败类
    2021-01-03 07:34

    [popoverController presentPopoverFromRect:self.dateOfBirthButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    

    Use sender in place of self.view

    [popoverController presentPopoverFromRect:((UIButton *)sender).bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    

提交回复
热议问题