First of all apologize for the article if it is duplicate.
After a lot of boxing with autolayout I don't get result. I am working on a application that manages on both phone and iPad.
As I implemented design with autolayout in iPhone mode with all trait vary versions when trying to make it in iPad. I am getting this locked scenario. Here is screenshot
And this is screenshot for iPhone mode:
I have tried few attempts to correct this but every time I am getting this wierd scenario.
Anyone can suggest me how can I manage this in both device types?
Related
Currently I was designed and developed my app in iPhone . Now I wanted make my app universal(iphone and iPad).Please guide me what will be the efforts and challenges on design and development ? could you please explain the steps.
While developing a app and want to makeit a universal app you should have to -
Make sure the design compatible for both iPhone and iPad. you can check it
from physical devices or form the simulator.
Make sure all the fields are ok (not breaking down while switching the
devices).
Make sure all the scrolling are working for both iPhone and iPad.
The main efforts will be on the following areas.
UI
You will need to obtain a new design suited for iPad depending on what you already have. If it is a simple interface, you port it to be viewed on iPad without a new design. But usually you need a iPad specific design.
You will have to change the layout of most screens to make it look good on the iPad. If auto layout is already used, it will be a little bit simpler. Otherwise I guess you will need to start thinking about separate storyboards and xibs for iPad specific screens.
Code
Assuming there is no additional functionality specific to the iPad, the main areas of change in code will be the those handling view presentation logic, navigation and animation. It all depends on the design you need to implement, but generally I would say you will need to change code that handles animation, presents new view controllers, handles storyboards etc.
Resources
You will need to provide resources specific to your iPad design.
Testing
Obviously you will need to do a LOT of testing :).
Eg: For example, location handling. There are no modern iPhones without GPS hardware, but iPads without cellular capabilities do not have GPS. So you location handling code might have to be rechecked. (It broke for me :))
AppStore
You will need to provide app store screenshots for the iPad screens.
Does the application get auto resized when uploaded to the AppStore to fit all devices like iPhone 5 and iPhone 7+ ?
I'm asking this because I'm about to release a new app for the Appstore but in the simulator and on a real device the application doesn't gets resized and all the buttons and label etc are not where they should be.
I am also developing an iOS app, so I understand your problem.
The application doesn't get resized.
The buttons/labels won't be put wherever they should be as Xcode doesn't know where to put them. This is because the screen size varies with each device.
You should use constraints (really good tutorial) to put your buttons/labels wherever you want them to be. Another good tutorial
It's not automatic. You need to design your app to handle layouts on different devices. It's a rather complex subject. You'll need to learn about AutoLayout and size classes, among other topics. If your app isn't handling this correctly, it's not ready for the app store.
Firstly check your application is universal application .
Then You need to look at your Auto Layout constraints inside your storyboard.
Understanding Auto Layout
I have an app that is nearing completion. However, I don't know how to finish it so it will look good on all iOS devices. It's a portrait only app, and it is the same on all devices (bigger screens don't show anything extra or different from smaller devices).
How do I make constraints that will work on all devices? I know there are different size classes that Xcode has, but it seems tedious to go to each class and add specific constraints.
You should use Autolayout for all resizing of your UI. But if you still want to go with this, I found this thread What setting determines whether an app gets scaled for iPhone 6 and 6plus?
Again, try to use Autolayout, add constraints its very easy. If you wish to change your mind go through the tutorial and add constraints https://www.raywenderlich.com/115440/auto-layout-tutorial-in-ios-9-part-1-getting-started-2
I have a swift universal app that I submitted and was approve the first time. However, when I submit an update and it got rejected because did not run at iPhone resolution when reviewed on iPad.
I know that I need to use auto layout to fix the issue, but it will take me a while to learn that. I need to submit the update as soon as possible to fix some bugs in the first version. Is there quick way to fix this? My app is a simple app with only text, button, no images. My main target will be iphone users anyway rather than iPad. Is that possible to scale the screen up when it is run on ipad. When I changed the device from "universal" to "iphone" in my app setting, and launched the app on ipad in the simulator, it actually scales up. However, it doesn't when I choose the universal.
I know in swift, I can use the following code to detect users on iPad, but I don't know how I can scale the screen up to fit on iPad. Thank you.
UIDevice.currentDevice().userInterfaceIdiom == .Pad
I don't believe you will find a "quick-fix", but I'm not an expert on coding right now. This was the whole purpose of the Auto Layout features being implemented. AutoLayout allows your apps to scale independent of the device type you are using with a few caveats.
I know in SpriteKit game design you have a ScaleMode that can be set to .AspectFill, but I'm not entirely sure on just a regular View Controller without the AutoLayout.
I've been developing iOS apps for the past 3 years and learned to do so without the use of nibs and storyboards. With the release of iOS 8 and the new iPhones there are ALOT of factors to take into account when developing for iPhone and even iPad devices (Resolution, Screen size, etc.).
The first problem I ran into with Xcode 6 is you can't create a empty project anymore. The closest option is a single view application. I found the following answer here.
Now it seems that apple is really pushing auto-layout, the use of the size classes and the use of storyboards and Interface builder. Is there any way to support the native resolutions of the iPhone 5, 6 and 6 plus and do this programmatically? The only option I can see is defining the frame of each UI element for each device which will lead to a ton of code.
Auto layout IS programmatic. Apple has given the necessary API's to handle size classes entirely in code if you don't want to use interface builder or storyboards and there has always been ways of adding constraints in code too.
You might think IB is a silly tool for noob developers or is only for basic apps and you need more power or whatever your reason, but maybe trying to do every thing yourself in code is a bet you have now lost. Give tools a try.
It's referred to as VFL or Visual Format Language.
VFL Tutorial