I'm trying to draw a line from the bottom middle to the center of the screen. The values I was using for my two points seemed really odd so I knew something was off. I changed the aspect mode to aspectFit to see what was happening and lo and behold my view seemed to be in portrait even though my app specifies landscape. Does anyone know what is causing this? In the build settings I have only landscape checked.
Related
Hello stackoverflow community,
I have just added the constraints to my iPad app and would now like that if you hold the iPad across that you can scroll the page, because not everything fits on a transverse page. If the Ipad is upright you should not be able to scroll (there everything fits).
How can I make that happen?
Edit:
I would like to be able to use landscape mode on my app, which I originally designed to be portrait only. For this I have already inserted all constraints so that the size etc. fits. Now, however, the page is so full that it no longer fits on the complete display in landscape mode. Now I would like to be able to scroll down and thus the complete page is on the display. How it looks at the moment in portrait and landscape format I have loaded into the attachment (do not wonder the app is in German).
Landscape
Portrait
add your views into UIScrollView and set its contentsize, you can thencontrol what should be visible or scrollable for both portrait and landscape
In a mobile app developed by a friend when you are in landscape mode on an iPhone there are icons that overlap text.
I wonder if this is a common problem and if it is obvious to anyone what possible factors could cause this?
See screenshots below:
Regular
Landscape
There has to be an issue in the project with constraints. The text and the icons are not constrained to themselves so when the screen width changes their position changes as well. It looks like the icons are misplaced in the landscape view so I would start looking for the solution in that direction.
This is quite common and thankfully easy to fix mistake. New developers are working with fixed screen sizes and forget that there are multiple sizes to consider. Working with constraints will come along with experience so don't worry.
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.
I've been working on my first iPad based project which has proven a massive learning curve but I'm nearly there. I have a small issue left however.
I've got my iPad to work in all orientations as dictated by Apple however they keyboard always comes on from the Portrait position unless the user rotates the device first. Does anyone have any suggestions where this is coming from? Just can't seem to figure out the reasoning for it. Any thoughts much appreciated, I'm sure this is glaringly simple but I'm just pulling my hair out here.
The keyboard displays based on the device's true orientation regardless of the layout any views. If the device is in portrait, the keyboard displays in portrait and it will not change until the device is physically rotated to landscape.