Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
51734: updated scriscript to get the correct SourceRect from a UIBarB…
Browse files Browse the repository at this point in the history
…utton (#151)
  • Loading branch information
bubudrc authored and olegoid committed Feb 21, 2017
1 parent 448704c commit 5b18270
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ios8/DocPicker/DocPicker/DocPickerViewController.cs
Expand Up @@ -207,7 +207,12 @@ public override void ViewDidLoad ()
if (presentationPopover!=null) {
presentationPopover.SourceView = this.View;
presentationPopover.PermittedArrowDirections = UIPopoverArrowDirection.Down;
presentationPopover.SourceRect = ((UIButton)s).Frame;
// Get UIBarButtonItem's frame
// there is no built in way to get a UIBarButtonItem frame so you need to hack your own
// This is because UIBarButtonItem inherits from UIBarItem and UIBarItem inherits from NSObject
var buttonView = (UIView)((UIBarButtonItem)s).ValueForKey(new NSString("view"));
presentationPopover.SourceRect = buttonView.Frame;
}
};

Expand Down

0 comments on commit 5b18270

Please sign in to comment.