UIMenuController not showing up
UIMenuController not showing up
- Subject: UIMenuController not showing up
- From: Ignacio Enriquez <email@hidden>
- Date: Thu, 19 Aug 2010 15:39:00 +0900
Hi,
I am implementing my own TextView using CoreText and would like it to
resemble to the original UITextView
Specially when long-pressing it.
When my view is firstResponder, the keyboard is shown and the
UIMenuController shows up as expected
When is not firstResponder is not shown.
As suggested here:
http://www.cocoabuilder.com/archive/cocoa/289594-iphone-uimenucontroller-not-showing-up.html
I tried overriding UIWindow's UIResponder methods (I didn't subclass
it I just made two categories)
//UIWindow+responder.h
@interface UIWindow (responder)
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender;
- (BOOL)canBecomeFirstResponder;
@end
//UIWindow+responder.m
@implementation UIWindow (responder)
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender{ return
YES; } //just for test purposes all actions are accepted
- (BOOL)canBecomeFirstResponder{ return YES; }
@end
added
#import "UIWindow+responder.h" to my textView .h file
but nothing happens, above methods are never called. I wonder where
should I write this methods? Or maybe this is not the correct way?
My real question is how can I show a UIMenuController when that view
is not firstResponder?
Any help is appreciated
--
*************************************************************************
Guillermo Ignacio Enriquez Gutierrez
*************************************************************************
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden