0

プログラムによるビューの制約に PureLayout を使用しています。サイズ、X と Y のアドレスが正しく設定されていると思いました。ただし、コードを SE と 7 Plus で実行すると、ビューが正しく整列しません。

コードのスニペットを次に示します。

 if (shouldSetupConstraints) {
        // bg
        backgroundView.autoPinEdgesToSuperviewEdges()
        // positions
        emailTextField.autoPinEdge(toSuperviewEdge: .top, withInset: 170)
        emailTextField.autoPinEdge(toSuperviewEdge: .left, withInset: 60)
        passwordTextField.autoPinEdge(toSuperviewEdge: .top, withInset: 250)
        passwordTextField.autoPinEdge(toSuperviewEdge: .left, withInset: 60)
        loginButton.autoPinEdge(toSuperviewEdge: .top, withInset: 350)
        loginButton.autoPinEdge(toSuperviewEdge: .left, withInset: 75)
        recoverButton.autoPinEdge(toSuperviewEdge: .top, withInset: 410)
        recoverButton.autoPinEdge(toSuperviewEdge: .left, withInset: 60)
        // confirms setup is done
        shouldSetupConstraints = false
    }

Retina スクリーンでもスクリーン ポイントは同じだと思っていたのに、なぜこれらの数値に差異が生じるのでしょうか?

4

2 に答える 2