0
私のプログラムビューの制約にPureLayoutを使用しています。私は彼らが正しくセットアップされていると思った、サイズ、XとYが対処。しかし、SE Plus 7 Plusでコードを実行すると、ビューが正しく配置されません。ここでPureLayout制約を正しく設定していますか?
は、コードの抜粋です:
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
}
私は、画面のポイントは、網膜の画面上で同じであったので、なぜこれらの数値と差異があるだろうと思いましたか?
4方向すべてを使用していますが、同じ値を使用すると、1からの位置付けではなく、 – jackdm
今のように同じ値を使用しないで、レイアウトに従って正しい値を計算してください。 – the4kman
私はあなたがどういう意味を持っているか分かりません。 – jackdm