swift - iOS dynamic UI in simple terms? -


This can be very basic or may require rephrasing. I am in the process of learning Swift and iOS programming and have developed a basic application that runs successfully on my iPhone 5. The app contains a label, a button and a UIImageView. It seems that I want to do it on my iPhone 5.

I just play that I am preparing all these elements with a programmer. The code looks like this:

  Banner = UILBL (frame: CGRTX (X: 10, Y: 10, width: 300.0, height: 75.0)) button = UI button (frame: CGRT) (X: 45, Y: 75, width: 235.0, height: 60.0)) imageView = UIImageView (frame: CGRTX (X: 22, Y: 150, width: 280.0, height: 410.0))   

And then I configure them to show the content in viewDidLoad

Now the question ... how do I get the right size when running on different devices? Aun? I can load the app on my iPad Mini, but it's all about the left side of the scene. So I need to do some sort of dynamic layout, but it is not sure where to start from.

Appreciate all help!

Clearly see the size of initWithFrame: with consultants Instead, you can programmatically create your ideas programmatically on your ideas for layout and NSLayoutConstraints as if you used the auto layout with the interface builder. For more details, See.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -