---
title: "IOS 改变模态窗口大小"
author: "jguangyou"
date: "2012-11-15T18:45:28Z"
tags: []
categories: ["移动开发"]
slug: "ios"
draft: false
lastmod: "2012-11-15T18:45:28Z"
id: 1727105
url: "https://deep-fish.iteye.com/blog/1727105"
---

每种样式的模态窗口的大小都是固定的，这个真心不好，如何改变呢，其实是可以的

方法：在调用，不对，是发送消息，在给试图控制器发送presentModalViewController消息后，重新设置视图的父视图的Frame即可，比如：

 rc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

    rc.modalPresentationStyle = UIModalPresentationFormSheet;

    \[self presentModalViewController:rc animated:YES];

    rc.view.superview.frame = CGRectMake(0, 0, 200, 200);

 

 

具体为什么，高人解答吧。欢迎留言。