How Can I make some of my UIViews to be orientation independent and some of them dependent. I'm looking for effect similar to this in standard iOS 9 Camera App when user change orientation from Portrait to Landscape. In Camera View Controller only left Icons and Right Icons are rotating but the internal view stays on position independently.
Related
I have a very simple iOS App (Xcode 8, SWIFT 3), containing a UILabel. It appears some way down the screen when in portrait orientation (Regular, Compact) when using Interface Builder for iPhone 6s. When I rotate to Landscape (Compact, Compact), I cannot get any combination of layouts to move this control to the right-hand half of the landscape view. There is plenty of room for it, but I just cannot work out how to achieve it. I just want it (and a few other controls) to appear in a different place when in Landscape view.
According to my client's requirement I want to set Splash Screen orientation in landscape(right) then the orientation will come in portrait.. any idea how can I implement it?
Just rotate your splash image in an external editor so that is gets displayed in a landscape mode.
Just because you perceive it as landscape doesn't mean it's actually not "rotated portrait".
See your Splash Image will look like this:
Just rotate your image the way you want it to look like...
The iPhone only has a single splash screen, no matter which orientation it launches in. The iPad on the other hand will display a different splash screen image in portrait and in landscape mode.
If your iPhone interface supports both portrait and landscape then you must decide which way round you'd like to display that splash screen image. As Kanan says, design your landscape image (say in Photoshop), then rotate the canvas so that the image is portrait (but the content is still landscape).
How to make a view with 3x4 thumb ImageViews in portrait mode and 4x3 thumb ImageViews in landscape orientation exactly that looks like
The orientation effect in iPad home screen icons change/animation effect from landscape to portrait vice verse..I have gone through the app (https://github.com/jarada/myLauncher) but it has the effect that it looks like going to set the frames every time device rotates.
Guide me how to design it a sample tutorial link
You can use UICollectionViewController, adjust its layout to return the desired sizes & locations for your icons.
This tutorial can help you create a custom UICollectioViewLayout.
Hope it helps.
I have the following code in the viewWillAppear function:
CAGradientLayer *bgLayer = [BackgroundLayer yellowGradient];
[bgLayer setBounds:self.view.bounds];
[self.view.layer insertSublayer:bgLayer atIndex:0];
It works perfectly in portrait orientation. However, when the device goes into landscape mode, it produces a white (or default color) background down the side. I have seen other examples of WHY this occurs, but nothing on how to fix it.
What I’m seeing happening is the 1024 resolution on landscape (iPad) dropping to 1004, and I think it’s adjusting it to 0,20 on the x, y.
Has anyone else run into this issue and found how to fix it?
It’s because when you turn the screen sideways, your view, which has a certain background color, does not turn sideways. The view remains in portrait. So you have this portrait-oriented colored view that’s going from the new “top” of the iPad to way below off screen, and on the right side, the view isn’t wide enough to reach, so you just see the app’s default (white) background color.
You can:
apply a CGAffineTransformMakeRotation rotation to your self.view 90º, so that it now displays properly in your now-landscape application,
make your view big enough to cover the entire device, in both landscape and portrait,
make a view with the proper landscape dimensions, and add it when the iPad rotates, or
disable those allowed interface orientations in your Xcode main project file.
Link to CGAffineTransformRotation Demo Code on SO: How to use CGAffineTransformMakeRotation?
In my iPad app, i am supporting only portrait mode except on one screen. I have tab bar at bottom, on click of any tab,it opens a small view of size 320.0 * 600.0, with table view. On selecting any row in small view, a full screen view opens up. Problem is that when i came on full screen view which supports all orientations, next time,my other view especially the small view comes up with frame size of 768 * 1024.
Any sugeestions or help is appreciated!
I'm guessing the problem is that you read the frame size while still being in landscape mode. If you are running things in the simulator, it probably jumps back to portrait when you dismiss the full screen? This forces the app back to "portait" mode without triggering the normal "willRotate" functionality, and could possibly mess up your code for keeping track of orientations.
Also keep in mind that most apps needs to support all orientations on the iPad to get accepted, unless you're making e.g. a game which is normally specifically designed for either landscape or portrait.