2017-09-01 7 views
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 
    } 

私は、画面のポイントは、網膜の画面上で同じであったので、なぜこれらの数値と差異があるだろうと思いましたか?

答えて

0

論理解像度はで、iPhone SE(320x568)と7 Plus(414x736)では同じではありません。

すべての制約を上または左から配置する代わりに、指定されたスーパービューのすべての面を使用してみてください。

+0

4方向すべてを使用していますが、同じ値を使用すると、1からの位置付けではなく、 – jackdm

+0

今のように同じ値を使用しないで、レイアウトに従って正しい値を計算してください。 – the4kman

+0

私はあなたがどういう意味を持っているか分かりません。 – jackdm

関連する問題