Code Monkey home page Code Monkey logo

calculator-layout-ios13-completed's Introduction

App Brewery Banner

Calculator Layout Challenge Solution

These are the steps to achieve this layout:

  1. Place all the buttons buttons in horizontal stacks to represent the rows (5 in total) - Stack Properties: Alignment: Fill, Distribution: Fill Equally, Spacing: 1

Image 1

  1. Place the Label and all 5 Horizontal Stacks from step 1 into a single Vertical Stack - Stack Properties: Alignment: Fill, Distribution: Fill Equally, Spacing: 1

Image 2

  1. Vertical Stack Pinned to all four edges of superview

Image 3

Bronze Medal: Change the constraints set in step 3 to be relative to the Safe Area instead of superview.

Image 4

Silver Modal: If you want the label to have padding on the left and right, you'll need to embed it in a View and then set 2 pin constraints from the label to the view of 20px each side and 2 pic constraints from the top and bottom of 0px.

Image 5 Image 6

Gold Medal: If you want the 0 button to take up as much space as the . and =, you'll need to embed the . and = in their own horizontal stack, then embed the 0 and that horizontal stack in a new horizontal stac. This will make the 0 button take up the same space as the other two buttons. Both Horizontal Stacks need to have Distribution set to "Fill Equally".

Image 7

This is a companion project to The App Brewery's Complete App Development Bootcamp, check out the full course at www.appbrewery.co

End Banner

calculator-layout-ios13-completed's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.