加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – preferredContentSize不工作,而不是contentSizeForVie

发布时间:2020-12-14 20:06:41 所属栏目:百科 来源:网络整理
导读:我正在从事项目,我想使我的应用程序与 IOS7兼容. self.contentSizeForViewInPopover = CGSizeMake(90,1 * 65 - 1); 这个方法已经从ios7弃用了 新方法是self.preferredContentSize = CGSizeMake(90,1 * 65-1); 但我没有得到适当的UI 但是当我改变ios7兼容方法
我正在从事项目,我想使我的应用程序与 IOS7兼容.

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

这个方法已经从ios7弃用了

新方法是self.preferredContentSize = CGSizeMake(90,1 * 65-1);

但我没有得到适当的UI

但是当我改变ios7兼容方法时,我的看法就是这样

与ios7方法我得到这个

解决方法

这在苹果文档中给出:

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;

我已经实施了处理像这样的popover的内容大小其工作:

self.popController.popoverContentSize = CGSizeMake(430,460);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读