私はアプリケーションを作成してUITextViewおり、サブクラスUITextViewを使用してテキストのアウトラインを作成しようとしています。を使用するUILabelと、以下の例を使用して実行できますが、UITextView提供されませんdrawTextinRect。でテキストのアウトラインを作成する方法について何か提案はありUITextViewますか?
- (void)drawTextInRect:(CGRect)rect
{
CGSize shadowOffset = self.shadowOffset;
UIColor *textColor = self.textColor;
CGContextRef context = UIGraphicsGetCurrentContext();
self.shadowOffset = CGSizeMake(0.0, 0.0);
CGContextSetLineWidth(context, [[self font] pointSize]/8.0);
CGContextSetTextDrawingMode(context, kCGTextStroke);
self.textColor = [UIColor blackColor];
[super drawTextInRect:rect];
CGContextSetTextDrawingMode(context, kCGTextFill);
self.textColor = textColor;
self.shadowOffset = CGSizeMake(0, 0);
[super drawTextInRect:rect];
self.shadowOffset = shadowOffset;
}