Passing touches between stacked UIWindows?

后端 未结 3 1342
不知归路
不知归路 2021-01-01 10:32

I have two windows -- a front one, and a back one. The front one is used to overlay some stuff on top of the back one. I want to be able to capture touches on some parts of

3条回答
  •  星月不相逢
    2021-01-01 11:01

    Instead of using multiple UIWindows, get the key window with [[UIApplication sharedApplication] keyWindow], then add your view to it:

    mainWindow = [[UIApplication sharedApplication] keyWindow];
    [mainWindow addSubview:view]
    

提交回复
热议问题