为什么我这里用systemFontSize 无法运行

来源:4-5 UILabel字体的使用

Temiy

2018-03-01 13:43:45

UILabel *label2 =[[UILabel alloc]initWithFrame:CGRectMake(20, 180, 300, 50)];


    label2.text =@"文本添加2";

    label2.textColor =[UIColor redColor];

    label2.backgroundColor =[UIColor grayColor];

    label2.font =[UIFont systemFontSize:12.0];



    [self.view addSubview:label2];

提示为:No known class method for selector 'systemFontSize:'

写回答

1回答

Tender10

2018-03-01

方法名是systemFontOfSize哦,你的方法名写错啦,中间少了Of,修改一下就可以了。

0
hemiy
h 非常感谢!
h018-03-02
共1条回复

0 学习 · 1878 问题

查看课程