-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Would be great if the current implementation of the CopyLabel control ( in iOS project ) would have following extra extensions: highlight the label control with a given colour if the Copy popmenu is visible.
I've already tried to add this behaviour by adding following code in the private void OnLongPress(UIGestureRecognizer recognizer) method:
if (recognizer.State == UIGestureRecognizerState.Began)
{
this.BackgroundColor = new UIColor(red: 0.78f, green: 0.78f, blue: 0.80f, alpha: 1.0f);
BecomeFirstResponder();
var copyMenu = UIMenuController.SharedMenuController;
copyMenu.SetTargetRect(Bounds, this);
copyMenu.ArrowDirection = UIMenuControllerArrowDirection.Default;
copyMenu.SetMenuVisible(true, true);
_notification = UIMenuController.Notifications.ObserveDidHideMenu((sender, args) =>
{
this.BackgroundColor = UIColor.Clear;
_notification.Dispose();
});
}
But somehow this doesn't seem 100% correct. Because by adding this code, on the first longpress I always get the ObserveDidHideMenu too ( and only the first time ).
So any tips on this?
Metadata
Metadata
Assignees
Labels
No labels