preferredContentSize not working instead of contentSizeForViewInPopover

11,694

This is given in apple documentation:

This property allows direction manipulation of the content size of the popover. Changing the property directly is equivalent to animated=YES. The content size is limited to a minimum width of 320 and a maximum width of 600.

@property (nonatomic) CGSize popoverContentSize;

- (void)setPopoverContentSize:(CGSize)size animated:(BOOL)animated;

I have implemented to handle the content size of popover like this & its working:

self.popController.popoverContentSize = CGSizeMake(430, 460);
Share:
11,694
Anil Prasad
Author by

Anil Prasad

Updated on June 27, 2022

Comments

  • Anil Prasad
    Anil Prasad about 2 years

    I am working on project where i want to make my app compatible with IOS7.

    self.contentSizeForViewInPopover = CGSizeMake(90, 1 * 65 - 1);
    

    this method is deprecated from ios7

    new method is self.preferredContentSize= CGSizeMake(90,1*65-1);

    but i am not getting proper UIenter image description here

    but when i am changing with ios7 compatiable method my view is like this

    with ios7 method i am getting this enter image description here

  • brainray
    brainray about 8 years
    Isn't this kind of dirty to have a property within the popover view controller to just adjust it's size? Is there no better way?