06 2012 档案
摘要:1.创建并初始化创建UITextView的文件,并在.h文件中写入如下代码:#import <UIKit/UIKit.h> @interface TextViewController : UIViewController <UITextViewDelegate>{ UITextView *textView;} @property (nonatomic, retain) UITextView *textView; @end在.m文件中初始化这个textview,写入代码如下:view sourceprint?self.textView = [[[UITextView a.
阅读全文
摘要:一、UILabel(1)初始化UILabelUILabel *scoreLabel = [ [UILabel alloc ] initWithFrame:CGRectMake((self.bounds.size.width / 2), 0.0, 150.0, 43.0) ];scoreLabel.textAlignment = UITextAlignmentCenter;scoreLabel.text = @"XXXXX";scoreLabel.textColor = [UIColor whiteColor];scoreLabel.backgroundColor = [UI
阅读全文
摘要:- (UIImage *)createImageWithColor:(UIColor *)color{ CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [color CGColor]); CGContextFillRect(context, rect); UIImag...
阅读全文