读书人

IOS4 note 五(2)

发布时间: 2012-07-01 13:15:00 作者: rapoo

IOS4 note 5(2)

?

?

In this example, we used the presentPopoverFromBarButtonItem:permittedArrowDirections:animated:instance method of our popover controller to display the popover on a barbutton. Sometimes you may need to display a popover on a certain point on a certainview. In those cases, you need to use the presentPopoverFromRect:inView:permittedArrowDirections:animated:? instance method of? the popover?controller where the presentPopoverFromRect parameter will specify therectangular area from where the popover has to be displayed.

?

action on its contents, such as tapping ona button—you can set the modalInPopoverproperty? of? the?view? controller? that?is? displayed? in?the? popover? to?YES.? If? we? setthis property to YES in the AddNewViewController’s viewDidLoad method, as shownhere, the popover that gets displayed on the root view controller will not bedismissed if the user taps on any other view on the screen:

- (void)viewDidLoad {

?[super viewDidLoad];

?self.modalInPopover = YES;

?self.contentSizeForViewInPopover = CGSizeMake(200.0f,

???????????????????????????????????????????????168.0f);

}

读书人网 >操作系统

热点推荐