Guest User

Untitled

a guest
Aug 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. Adjust arrow direction for UIActionsheet in iPad app
  2. float x=offset.x;
  3. float y=offset.y;
  4. float w=newPop.frame.size.width;
  5. float h=newPop.frame.size.height;
  6. if(offset.x < 150)
  7. {
  8. x = 160;
  9. w = w-180;
  10. }
  11. else if(offset.x > 600)
  12. {
  13. x= 600;
  14. //w= w+180;
  15. }
  16.  
  17. CGRect myImageRect = CGRectMake(x, y, w, h);
  18.  
  19.  
  20. [newPop showFromRect:myImageRect inView:_calDay animated:YES];
  21.  
  22. NSSet *allTouches = [event allTouches];
  23. UITouch *touch = [[allTouches allObjects] objectAtIndex:0];
  24. CGPoint p = [touch locationInView:self.view];
  25.  
  26.  
  27. if(popoverController)
  28. [popoverController dismissPopoverAnimated:YES];
  29.  
  30. popOverController *obj_popOverController = [[popOverController alloc] initWithNibName:@"popOverController" bundle:nil];
  31. UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:obj_popOverController];
  32. popoverController = [[UIPopoverController alloc] initWithContentViewController:navController];
  33. [popoverController setPopoverContentSize:CGSizeMake(320.0, 320.0)];
  34. [popoverController presentPopoverFromRect:CGRectMake(p.x, p.y, 10, 10) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown animated:YES];
  35. [navController release];
Add Comment
Please, Sign In to add comment