使用topLayoutGuide等效safeAreaLayoutGuide.layoutFrame.origin

时间:2017-10-16 00:14:50

标签: ios iphone ios10 ios11

对于iOS 11+,

topLayoutGuide属性已弃用,现在我们必须使用safeAreaLayoutGuidehttps://developer.apple.com/documentation/uikit/uiviewcontroller/1621367-toplayoutguide)。

如何使用safeAreaLayoutGuide.layoutFrame.origin.y定位&lt; topLayoutGuide来获取/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner in = new Scanner(System.in); int num1; int num2; num1 = in.nextInt(); num2 = in.nextInt(); for(int i = num1; i <= num2; i++) { System.out.print(i + " is evenly divisible by "); for(int j = 1; j <= i; j++) { if (i % j == 0) { System.out.print(j + " "); } } System.out.println(); } } } 的值iOS 11?

1 个答案:

答案 0 :(得分:0)

我设法使用self.view.layoutMarginsGuide.layoutFrame.origin.y * self.view.layoutMarginsGuide.layoutFrame.origin.x获得相同的值。