Stacks and Auto-layout across iOS devices [closed] - ios

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So I'm following a set of tutorials and have come to a point where I have the app working (A simple calculator), but the UI could still be improved.
The current UI works great on phones, but when going up to an iPad, parts of the UI expand as needed, but the buttons stay at quite a small size. I have no constraints keeping the buttons small and the stack that the buttons are in do expand to fill the space.
My project files can be found here:
https://github.com/maza256/retrocalc
An image to explain is found here:
iPhone and iPad Preview image
Any help would be great.

After looking at your project I found one change that you can make. Go to storyboard and select the buttons then click on attribues inspector. Then under control change the alingment options on the far right, which will cause your image to expand to fit the space.
Ipad
Inspector Setting
Sorry that i didn't catch this in my post. But you will need to click on the stack view for the top row of numbers and make sure to make the stack view settings like this.

Buttons are the right size. They are not small and behave as you expect. Try to change background color:
iPad screenshot
The problem is that you have very small images. You have to provide .#2x and .#3x images, so you won't lost quality on iPad.
Image assets

Related

Create grey transparent alert [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am looking for either the terminology or a reference on how to do this.
When you Successfully build a project on Xcode a nice, looking alert pops up. Like the one below:
I have found only one other question on how to recreate this for Mac OS. I want the iOS version. I want to use this alert to show a count down for a timer. I have the count down fully functional but I'm not sure of a good way to display. I think this would be ideal for it.
I have the count down fully functional but I'm not sure of a good way to display
It's simply a view (UIView), with a transparent grey background color, rounded corners, and a light shadow. All of that can be readily be configured by straightforward view and layer properties in about three lines of code, and showing the view can be as simple as one line of code.

Xcode - Swift arrange images in a grid 2x4 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am developing a universal iOS app. I am looking to achieve the below grid layout using 8 images (inclusive of the text).
My skills of autolayout are poor, especially for universal apps. I would like the layout to remain for iPad and smaller screen devices, and scale the images accordingly.
I am unsure how to achieve this. Could you suggest a method and perhaps point me in the right direction by providing suggestions on methods to achieve this, such as UICollectionView or grid layout using autolayout.
Collection view! It's a great way to arrange things in a view like this that automatically adapts to screen size.
Apple docs - https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/
Simple example you can follow - How to make a simple collection view with Swift
UICollectionView is a powerful tool, can be tricky to nail down at first but follow along on the tutorial and you should be able to make your design in no time!

Constraints in Xcode (Swift 2 iOS App) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm making a simple iOS app in xcode using Swift and while I have the entire backend figured out (and it works perfectly), I don't understand constraints AT ALL. I'm trying to make my layout adaptive so it works on all iphone screens but I'm having a really difficult time. Any suggestions on how I can create the perfect layout? Resources would be helpful too. Most resources don't explain the concept or start from scratch.
Another issue I'm having is that every time I click on something, e.g. a table cell, and uncheck "Constrain to margins" and set the constraints, the changes aren't saved and as soon as I hit enter they revert back to the original settings.
REALLY lost on this whole constraints thing. Thanks!
So for learning constraints, I would advice you to do this tutorial. It is lengthy but it covers a lot of important concepts.
www.raywenderlich.com/115440/auto-layout-tutorial-in-ios-9-part-1-getting-started-2
As for constraint to margins, you need to deselect "constraint to margins" before you edit the values. And once you edit a value, make sure the red lines are activated, and do not click on add constraints until you are sure of all the values. (1)
(Image 1)
You can check and edit the constraint in this window, just select your view and go here (2)
(image 2)

Using Different Screen Sizes [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have an app made for a iPhone 5 screen and am having trouble making it so that it will look the same on a iPhone 4. I can't seem to figure out how to use both screen sizes without making 2 storyboards because there are about 35 views. Any answer that may help me fix this problem will be greatly appreciated.
Sincerely, Nick
~Beginner at IOS Development
Create the views more dynamic. For instance does a tableview fill up the extra space with rows. Autolayout can help increasing the distance between UIElements for this.
The old (iOS 6) way to disable iPhone 5 was not to submit the iPhone 5 Splashcreen. Afaik this "trick" isnt working anymore.
Best have a look on xcode 5. It can switch the storyboard from 4"to 3.5"on the fly and respects autolayout. Consider it as a great opportunity to get used to autolayout. (You will need it in the next gen of devices it seems)
Edit:
Make sure the top most view does resizing and this resize is passed down to your table/collectionview
If you use Autolayout then just pin the 4 borders of the collection view,
If you dont use autolayout, refer to picture 2 and make sure the autosizing behaves the same. Either way will work.

iphone / ipad differences and conversion [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
is there any code difference between ipad and iphone? How can we convert iphone application to ipad application?
Codewise, the main difference is in the very different screen sizes leading to different user interface considerations. But there are a number of differences. For example,
Some classes, such as UIPopoverController and UISplitViewController, are only usable on one type of device.
Some classes behave differently, for example UIActionSheet doesn't come up from the bottom on iPad and doesn't display the cancel button (as cancelling is done by touching anywhere outside the bounds of the sheet).
Some methods don't work right on one or the other device. For example, some of the methods for presenting a UIActionSheet should only be used for iPad, and others should only be used for iPhone.
Some behaviors are only available on one or the other device. For example, UIViewController's modalPresentationStyle is ignored on iPhone.
Most of these are documented, some only show up as warnings in the console when using the "wrong" method, and some you just have to figure out they don't work right. Fortunately, UI_USER_INTERFACE_IDIOM() makes it easy to tell which device your code is running on so you can easily handle these differences.
It is exactly the same except for the dimensions of the screen. There are still some code changes though to enable iPad mode if you are writing a cross compatibile app.
Resource:
http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html

Resources