开发者

UIView loaded from segment managing view is not resizing in landscape mode

开发者 https://www.devze.com 2023-03-02 17:23 出处:网络
SegmentManagingView I am trying to do something like above link. I set the Rotation code in my segmentmanagingview

SegmentManagingView

I am trying to do something like above link. I set the Rotation code in my segmentmanagingview

But it is not resizing in landscape mode.Table's wi开发者_开发问答dth is 320 px in landscape and portrait mode.Any other way to achieve this?


First read Apple's Why won't my UIViewController rotate with the device or the many links on SO to see if rotation is being allowed. Most of the time this will fix it. Other approaches are:

  • Implement didRotateFromInterfaceOrientation and implement a relocation (setting new centers for each view).
  • Duplicate the view and swap the subviews (iterating the subviews and replacing one with the other).
  • Switch views (create a landscape and portrait view on the same nib and change the active view).

There are examples for all three techniques on the iPhone Developer's Cookbook from Erica Sadun. The source code is free to download, look for chapters 2-3.

0

精彩评论

暂无评论...
验证码 换一张
取 消