将视图放在右下角,隐藏部分,以编程方式快速移动5

时间:2019-08-13 12:14:05

标签: ios swift xcode

我想以编程方式移动图像中的视图,以获得类似于轮盘赌1/4的效果。

enter image description here

但是我只能在一个屏幕的代码中将其显示在下面。

    let X_Position:CGFloat? = 150.0 //use your X position here
    let Y_Position:CGFloat? = 300.0 //use your Y position here
    circle.frame = CGRect(x: X_Position ?? 0,y: Y_Position ?? 0,width: 
    circle.frame.width,height: circle.frame.height)

如何在所有屏幕上获得该位置?

1 个答案:

答案 0 :(得分:1)

快捷键4

没有动画:

4402 Aug 13 19:56:01 zjp kernel: [117908.066176] oops: loading out-of-tree module taints kernel.                                                                            
4403 Aug 13 19:56:01 zjp kernel: [117908.066180] oops: module license 'unspecified' taints kernel.                                                                          
4404 Aug 13 19:56:01 zjp kernel: [117908.066181] Disabling lock debugging due to kernel taint                                                                               
4405 Aug 13 19:56:01 zjp kernel: [117908.066242] oops: module verification failed: signature and/or required key missing - tainting kernel                                  
4406 Aug 13 19:56:01 zjp kernel: [117908.066491] oops from the module
4407 Aug 13 19:56:01 zjp kernel: [117908.066498] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000                                                  
4408 Aug 13 19:56:01 zjp kernel: [117908.066503] PGD 0 P4D 0

带有动画:

let screen = UIScreen.main.bounds
let circleViewRect = circlemenu.frame

circlemenu.frame = CGRect.init(x: screen.width - circleViewRect.width/2, y: screen.height - circleViewRect.height/2, width: circleViewRect.width, height: circleViewRect.height)

我相信您使用的是旧版的swift,请随时更改功能