Vin*_*ath 19 uiactionsheet autorotate ios-simulator
其他一些人已经提出了这个问题,但它从来没有被回答过.问题似乎微不足道,但Apple的文档或其他地方尚未解决.
我正在使用以下showInView方法呈现我的UIActionSheet实例:
UIActionSheet *myActionSheet = [[UIActionSheet alloc] initWithTitle:@"Test" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destroy" otherButtonTitles:@"One", @"Two", nil];
[myActionSheet showInView:self.view];
Run Code Online (Sandbox Code Playgroud)
UIActionSheet在中心以任何方向呈现,但是当我旋转iPad时,它会在top-right或中看到bottom-left(取决于方向是否更改为纵向或横向).
如果将自动调整大小设置为UIViewAutoresizingFlexibleBottomMargin和UIViewAutoresizingFlexibleRightMargin,这是大多数视图元素的默认autoresizingMask值,则会出现这种情况,因此我尝试通过调用setAutoresizingMaskUIActionSheet实例上的方法来重置该值.
[myActionSheet setAutoresizingMask:UIViewAutoresizingNone];
Run Code Online (Sandbox Code Playgroud)
但是,Autoresizing Mask的这个或任何其他价值都无法实现任何改变.
有没有解决这个问题的方法?我宁愿不诉诸于解雇UIActionSheet轮换并重新展示它 - 原则上这种方法似乎是不必要的.
| 归档时间: |
|
| 查看次数: |
627 次 |
| 最近记录: |