I am building an iOS app that only presents in portrait orientation on the iPhone. (The views do not change when a user rotates the device.)
However, when users connect to an Apple TV, I want to make the views always present in landscape orientation on Apple TV even the iPhone presents in portrait orientation.
How do I achieve this?
Sorry, I read your question wrong the first time. Have you considered an option such as this: "Some video-oriented apps send their content directly to the AirPlay receiver when AirPlay is enabled—bypassing the iOS device’s screen (or displaying a message like “The video is playing on Apple TV”)". So in theory you might just be able to bypass the iphone and just deal with the apple TV settings.
Related
So I have a video app for tvOS and I would like to serve ads on it, but one of the requirements is to not serve them while the TV is not showing them.
All good, but if you change the source of your TV and the Apple TV is still running it will continue to run and not lock or turn off while watching the videos. I thought that the resign active notification or entered background will give me that information, but they do not.
Is there any way to check if tvOS is currently on screen?
I am using tvOS 12 and AVPlayer.
I'm struggling to make banner ads work properly in my iOS 7 app for the iPad.
Per the Apple Developer's guide, I
1)linked the iAd Framework,
2)imported the iAd header to my controller.h file, and
3) enabled canDisplayBannerAds = YES in the controller.m file.
When I run either (in simulator or on iPad), it displays the banners properly at the bottom of the screen in portrait mode.
However, when I turn to landscape mode, it displays the banners along the left side of the screen, as if it were portrait mode. I cannot seem to figure out how to make it display along the bottom of the screen in landscape mode?
we have created iPhone game with landscape only mode, but screenShot our designer created are in portrait mode. Does apple iTunes connect allow this ?
Your app won't get rejected if the images share the same content in pics and in the app. The orientation of the pics is irrelevant as long as everything else ok by apple. Worst case scenario (which I very much doubt) they will ask you to upload new pics.
Is there any way to differentiate between landscape and portrait when the device is sitting on a desk, i.e. UIDeviceOrientationFaceUp? I have two different xib files that I switch between based on the way the user is holding the device. But the problem arrises when I hold the device in landscape, and then place the device down. The device remains in landscape, but will load the portrait xib file. The problem would be opposite if in my coding I coupled the UIDeviceOrientationFaceUp with the landscape orientations: then I would have my landscape view showing when the device is still in portrait.
Is there any way to be able to figure out if the device is still showing landscape or portrait? I have tried checking frame width, but it claims it is 768 even if the device is sitting flat in landscape. And I can't force an orientation when the device goes flat, I hear thats the road to rejection on the App Store.
You can't do that. The accelerometer can't tell on which side of the phone the user is sitting when it's laid down on a table. You can measure rotation around it's axis using the gyroscope (and the compass), but that still doesn't tell you where the user is unfortunately.
There is one way to check it.
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
UIInterfaceOrientation statusBarOrientation =[UIApplication sharedApplication].statusBarOrientation;
Use the first one to check if the device is in faceup and second one will tell you if the device is in portrait or landscape.
My goal seems simple: Replicate the behavior of the iPad 2 camera app with regard to previewing/taking still photos. Namely, I want to display the preview in a full-screen window.
Unfortunately this seems impossible on the iPad 2 with a UIImagePickerController. A UIImagePickerController must be hosted within a UIPopoverController, and according to the docs:
When changing the size of the popover’s content, the width value you specify must be at least 320 points and no more than 600 points.
This is fairly consistent with the results I've been seeing. Regardless of the size I specify, I see a small preview window. Is there a way to get around this with the UIImagePickerController?
The docs are confusing/wrong on this. You can also present the camera full screen using a navigation controller with presentModalViewController. This is exactly the same as on iPhone.
Note, this only works on a device, not on the simulator.