如何子类UITextView

时间:2012-05-12 18:14:34

标签: iphone uitextview subclass uiactionsheet uiresponder

如何将UITextView中的UIActionSheet子类化为canBeforeFirstResponder中的disable copy, select, and select all覆盖UITextView

#import <UIKit/UIKit.h>

@class English;

@protocol EnglishDelegate

- (void)dismissViewDidFinish:(UIViewController *)viewController;

@end


@interface English: UIViewController <UITextViewDelegate, UIScrollViewDelegate>


{
id<EnglishDelegate> delegate;
UITextView *textView;
UINavigationBar *navBar;
UINavigationController *navigationController;

}

@property (nonatomic, retain) UITextView *textView;
@property (nonatomic, assign) UINavigationBar *navBar;
@property (strong, nonatomic) UINavigationController *navigationController;
@property (nonatomic, assign) id<EnglishDelegate> delegate;
@property (nonatomic, retain) UIScrollView *scrollView; 

-(void)dismissView:(id)sender;

@end

任何人都知道如何在h文件中对其进行子类化。

感谢您的帮助。

1 个答案:

答案 0 :(得分:2)

你不会在另一个类中继承UITextView;您只需将其子类化为另一个文件,并覆盖canBecomeFirstResponder,如下所示:

- (BOOL)canBecomeFirstResponder {
    return NO;
}