Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 切换到UIPopoverPresentationController_Objective C_Ios8_Uipopovercontroller_Uipopover_Uipopoverbackgroundview - Fatal编程技术网

Objective c 切换到UIPopoverPresentationController

Objective c 切换到UIPopoverPresentationController,objective-c,ios8,uipopovercontroller,uipopover,uipopoverbackgroundview,Objective C,Ios8,Uipopovercontroller,Uipopover,Uipopoverbackgroundview,我想为我的iPhone应用程序创建相同的popover,大小为GGrectof(320 100.0)。 这是我的旧代码: View*pk1=[[View alloc]init]; UINavigationController*nav=[[UINavigationController alloc]initWithRootViewController:pk1]; pop=[[UIPOPCovercontroller alloc]initWithContentViewController:nav];

我想为我的iPhone应用程序创建相同的popover,大小为
GGrect
of
(320 100.0)
。 这是我的旧代码:

View*pk1=[[View alloc]init];
UINavigationController*nav=[[UINavigationController alloc]initWithRootViewController:pk1];
pop=[[UIPOPCovercontroller alloc]initWithContentViewController:nav];
[pop setDelegate:self];
[pop presentPopoverFromRect:[self-btnsavepart]。查看中的帧:[self-view]许可证行方向:UIPopOverErrorDirection任意动画:是];
[导航释放];
我使用这个代码,但它不会改变

nav.preferredContentSize = CGSizeMake(320, 100);
我无法使用
uipopoperpresentationcontroller
更改
uipoperpresentationcontroller

如何指定
(320 100.0)
GGrect

我认为我只能在水平方向上改变,但我怎么做呢

  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];
我希望UIPopoverPresentationController不是iPhone中的全屏形式

我添加了这些代码,但我给出了全屏视图

- (UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller
{


}

我使用Xamarin,但它是一样的,要指定要在其中显示UIViewController的popover的大小,在UIViewController的属性中,您有PreferredContentSize属性。在这里您可以指定大小


我在这里的某个地方看到了它,但忘记了它的位置。

可能是重复的我不认为它是重复的,因为“我不能用UIPopoverPresentationController更改UIpopovercontriller”。@jww为什么会有不同?这个问题中的OP试图使用
UIPopoverPresentationController
在这个问题中呈现一个popover,就像在重复的问题中一样。首先,它不是重复的,如果你有hi@user2296278,请给我解决方案。你找到解决方案了吗?
return NO;