我们现在要在列表页和详情页上添加静态的文字
UILabel *contentText = [[UILabel alloc] initWithFrame:CGRectMake(20, 84, [UIScreen mainScreen].bounds.size.width-40, 20)]; contentText.text = @"向狂想者致敬"; contentText.textColor = [UIColor blackColor]; contentText.font = [UIFont systemFontOfSize:15]; contentText.textAlignment = NSTextAlignmentLeft; [self.view addSubview:contentText];
静态文字长宽高都确定好了。动态文字的话长宽高需要计算。
这个设置就是一般套路,记牢就行。
原文:http://www.cnblogs.com/lansejidiao/p/6443383.html