How to add a view on top of a UIPopoverController

前端 未结 2 355
南旧
南旧 2021-01-03 08:13

I\'ve got an iPad app with a “drawer” table displayed in a popover. The user can tap-and-hold on an item in the drawer to drag that item out of it and into my main view. Tha

2条回答
  •  借酒劲吻你
    2021-01-03 08:44

    Got it. UIWindow works fine. Code:

    // when drag starts
    draggingView = [[UIWindow alloc] initWithFrame:CGRectMake(0,0,100,100)];
    draggingView.windowLevel = UIWindowLevelAlert;
    draggingView.center = [gestureRecognizer locationInView:self.view.window];
    [draggingView makeKeyAndVisible];
    
    // when drag ends
    [draggingView release];
    draggingView = nil;
    

提交回复
热议问题