第三课 页面内容文字1

  我们现在要在列表页和详情页上添加静态的文字

 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];

  静态文字长宽高都确定好了。动态文字的话长宽高需要计算。

这个设置就是一般套路,记牢就行。

 

posted @ 2017-02-26 00:16  racher  阅读(118)  评论(0编辑  收藏  举报