xLsDg

Xiao Lu Software Development Group

自定义单元

1.创建标签:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.label = [[UILabel alloc] initWithFrame:self.contentView.bounds];
self.label.opaque = NO;
self.label.backgroundColor =
[UIColor colorWithRed:0.8 green:0.9 blue:1.0 alpha:1.0];
self.label.textColor = [UIColor blackColor];
self.label.textAlignment = NSTextAlignmentCenter;
self.label.font = [[self class] defaultFont];
[self.contentView addSubview:self.label];
}
return self;
}
阅读全文 »

光标移动

命令 作用(解释)
h,j,k,l h 表示往左,j 表示往下,k 表示往右,l 表示往上
Ctrl+f 上一页
Ctrl+b 下一页
w,e,W,E 跳到单词的后面,小写包括标点
b,B 以单词为单位往前跳动光标,小写包含标点
O 开启新的一行
^ 一行的开始
$ 一行的结尾
gg 文档的第一行
[N]G 文档的第 N 行或者最后一行
阅读全文 »

延迟加载处理

代码示例:

1
2
3
4
5
6
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.blueViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Blue"];
[self.view insertSubview:self.blueViewController.view atIndex:0];
}
阅读全文 »
0%