Is this possible? How might I accomplish this?
Allow change of orientation to landscape for only one tab in UITabViewController
915 views Asked by esreli At
2
There are 2 answers
0
Andy Obusek
On
Not possible according to Apple Docs. All UIViewControllers must support the same orientations for any to be rotatable.
See this document (scroll down to the section titled "Tab Bar Controllers and Rotation": http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/TabBarControllers.html#//apple_ref/doc/uid/TP40011313-CH3-SW1
Related Questions in IPHONE
- Swagger: How do you add ApiModelProperty for 3rd party code?
- Why `additionalProperties` is the way to represent Dictionary/Map in Swagger/OpenAPI 2.0
- Allow swagger query param to be array of strings or integers
- How to refer to an external JSON file containing response examples in Swagger?
- How to generate JSON examples from OpenAPI/Swagger model definition?
- Swagger/OpenAPI - use $ref to pass a reusable defined parameter
- Provide alternate (international) spelling for defined Swagger route
- Unable to use tags in swagger documentation
- Hello,I am using swagger 3.0.0.The operation oneOf is not working here too?Where is the mistaken?
- How to document a response comprised of a list of resources using OpenAPI
Related Questions in IOS
- Swagger: How do you add ApiModelProperty for 3rd party code?
- Why `additionalProperties` is the way to represent Dictionary/Map in Swagger/OpenAPI 2.0
- Allow swagger query param to be array of strings or integers
- How to refer to an external JSON file containing response examples in Swagger?
- How to generate JSON examples from OpenAPI/Swagger model definition?
- Swagger/OpenAPI - use $ref to pass a reusable defined parameter
- Provide alternate (international) spelling for defined Swagger route
- Unable to use tags in swagger documentation
- Hello,I am using swagger 3.0.0.The operation oneOf is not working here too?Where is the mistaken?
- How to document a response comprised of a list of resources using OpenAPI
Related Questions in OBJECTIVE-C
- Swagger: How do you add ApiModelProperty for 3rd party code?
- Why `additionalProperties` is the way to represent Dictionary/Map in Swagger/OpenAPI 2.0
- Allow swagger query param to be array of strings or integers
- How to refer to an external JSON file containing response examples in Swagger?
- How to generate JSON examples from OpenAPI/Swagger model definition?
- Swagger/OpenAPI - use $ref to pass a reusable defined parameter
- Provide alternate (international) spelling for defined Swagger route
- Unable to use tags in swagger documentation
- Hello,I am using swagger 3.0.0.The operation oneOf is not working here too?Where is the mistaken?
- How to document a response comprised of a list of resources using OpenAPI
Related Questions in DEVICE-ORIENTATION
- Swagger: How do you add ApiModelProperty for 3rd party code?
- Why `additionalProperties` is the way to represent Dictionary/Map in Swagger/OpenAPI 2.0
- Allow swagger query param to be array of strings or integers
- How to refer to an external JSON file containing response examples in Swagger?
- How to generate JSON examples from OpenAPI/Swagger model definition?
- Swagger/OpenAPI - use $ref to pass a reusable defined parameter
- Provide alternate (international) spelling for defined Swagger route
- Unable to use tags in swagger documentation
- Hello,I am using swagger 3.0.0.The operation oneOf is not working here too?Where is the mistaken?
- How to document a response comprised of a list of resources using OpenAPI
Related Questions in UITABVIEW
- Swagger: How do you add ApiModelProperty for 3rd party code?
- Why `additionalProperties` is the way to represent Dictionary/Map in Swagger/OpenAPI 2.0
- Allow swagger query param to be array of strings or integers
- How to refer to an external JSON file containing response examples in Swagger?
- How to generate JSON examples from OpenAPI/Swagger model definition?
- Swagger/OpenAPI - use $ref to pass a reusable defined parameter
- Provide alternate (international) spelling for defined Swagger route
- Unable to use tags in swagger documentation
- Hello,I am using swagger 3.0.0.The operation oneOf is not working here too?Where is the mistaken?
- How to document a response comprised of a list of resources using OpenAPI
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The word possible may need an asterisk by it. It certainly looks like Apple didn't envision (or want) you doing this. But, depending on what your requirements are, there may be a workaround.
Disclaimer: this is kind of a hack. I'm not claiming this to be a good UI, just trying to show Eli what's possible.
I built an example, starting with the Xcode template for building a Tabbed Application. It has two view controllers:
FirstViewController
andSecondViewController
. I decided to makeFirstViewController
the landscape-only view. In Interface Builder (Xcode UI design mode), I set the orientation of the FirstViewController's view to landscape, and made its size 480 wide by 251 high (I'm assuming iPhone/iPod here).Solution
Now, what seems to be necessary is to have all the tab bar's view controllers claim to support autorotation to portrait and landscape. For example:
So, both my view controllers have that same code. However, what I do in
FirstViewController
is to also overridewillAnimateToInterfaceOrientation:duration:
and essentially undo what theUIViewController
infrastructure does, just for this one landscape-only view controller.FirstViewController.m:
What you get with this is that the tab bar will always rotate with the device. That's probably a requirement, to get your dual orientation views (e.g.
SecondViewController
) to do autorotation. But, the actual view content ofFirstViewController
now does not rotate. It stays in landscape orientation, no matter how the user turns the device. So, maybe that's partially good enough for you?Also of note:
1) I changed the app's info plist file to set the initial orientation to landscape (since my
FirstViewController
was the landscape one):2) In FirstViewController.xib, I set the main/parent
UIView
to not Autoresize Subviews. Depending on your view hierarchy, you may want to change this property in other child views, too. You can experiment with that setting.Now, the available size for your landscape view does change a little bit, as the status bar and tab bar are rotated. So, you may need to adjust your layout a little bit. But, basically, you will still get a wide view for showing landscape content, no matter how the user holds their device.
Results
Watch Youtube demo of running app