Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a4dbf0967c
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (34 sloc) 1.269 kb
//
// PSNonEdiableTextView.m
// PSFoundation
//
// Created by Peter Steinberger on 19.11.10.
// Copyright 2010 Peter Steinberger. All rights reserved.
//
#import "PSNonEdiableTextView.h"
#include "UIView+Sizes.h"
#import <QuartzCore/QuartzCore.h>
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1]
@implementation PSNonEdiableTextView
+ (id)textViewForText:(NSString *)text {
PSNonEdiableTextView *textView = [[[[self class] alloc] init] autorelease];
textView.textColor = RGBCOLOR(76,86,108);
textView.layer.shadowColor = [[UIColor whiteColor] CGColor];
textView.layer.shadowOffset = CGSizeMake(1, 1);
[textView.layer setShadowOpacity:1.0];
[textView.layer setShadowRadius:0.3];
textView.backgroundColor = [UIColor clearColor];
textView.scrollEnabled = NO;
textView.scrollsToTop = NO;
textView.editable = NO;
textView.textAlignment = UITextAlignmentCenter;
textView.text = text;
textView.font = [UIFont systemFontOfSize:14];
CGSize size1 = [textView.text sizeWithFont:textView.font constrainedToSize:CGSizeMake(300.0f, 9999.0f) lineBreakMode:UILineBreakModeWordWrap];
textView.height = size1.height + 10;
return textView;
}
- (BOOL)canBecomeFirstResponder {
return NO;
}
@end
Jump to Line
Something went wrong with that request. Please try again.