[iOS] 让某个 view 总是在最顶端/前面(front)
2017-07-07 本文已影响154人
CharlesQiu
Objective-C
#import <QuartzCore/QuartzCore.h>
myAlwaysOnTopView.layer.zPosition = MAXFLOAT;
Swift 3
myAlwaysOnTopView.layer.zPosition = .greatestFiniteMagnitude
参考资料:https://stackoverflow.com/questions/6511443/how-to-make-a-uiview-always-appear-at-the-front