0

I want to create the same popover for my iPhone app with size GGrect of (320 100.0). Here is my old code:

View * pk1 = [[View alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:pk1];
pop = [[UIPopoverController alloc] initWithContentViewController:nav];
[pop setDelegate:self];
[pop presentPopoverFromRect:[self btnsavepart].frame inView:[self view] permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
[nav release];

I using this codes but its doesn't change

nav.preferredContentSize = CGSizeMake(320, 100);

I can not change UIpopovercontriller with UIPopoverPresentationController.

How do I specify GGrect of (320 100.0)?

i thinks i can change only on horizontally but how can i do.

  View *viewController = [[[View alloc] init] autorelease];
    UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:viewController] autorelease];


    navController.modalPresentationStyle = UIModalPresentationPopover;
    navController.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionUp;
    navController.popoverPresentationController.sourceRect = btnsavepart.bounds;
    navController.popoverPresentationController.sourceView = btnsavepart;
    navController.popoverPresentationController.delegate = self;

    [self presentViewController:navController animated:YES completion:nil];

i want the UIPopoverPresentationController not FullScreen form in iPhone

i adding this codes but i give the FullScreen view

- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller

{

return NO;

}

user2296278
  • 528
  • 1
  • 4
  • 17
  • possible duplicate of [UIPopoverPresentationController on iOS 8 iPhone](http://stackoverflow.com/questions/25319179/uipopoverpresentationcontroller-on-ios-8-iphone) – Aaron Brager Sep 22 '14 at 01:24
  • I don't think its a duplicate because of *"I can not change UIpopovercontriller with UIPopoverPresentationController"*. – jww Sep 22 '14 at 01:30
  • @jww Why does that make a difference? The OP in this question is trying to use `UIPopoverPresentationController` to present a popover in this question, just like in the duplicated question. – Aaron Brager Sep 22 '14 at 02:11
  • 1
    first its not duplicate and please give me the solution if you have – user2296278 Sep 22 '14 at 09:50
  • HI @user2296278 didi you find the solution for that? – Ramakrishna Oct 26 '16 at 06:12

1 Answers1

0

I work with Xamarin but its same thing , to specify size of the popover in which you want to display your UIViewController, in the properties of your UIVIewController you have the PreferredContentSize property. There you specify the size.

I saw it somewhere here but forgot where.