更改集合视图单元格中文本 NSString 的大小
Changing size of text NSString in collection view cell
我在集合单元格中有文本。 如何更改 NSString 文本的大小?我已经尝试过类似
的方法
cell.author.text.font = [UIFont systemFontOfSize:12.0];
但是不允许,它说 属性 'font' not found on object of type 'NSString'
CollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
cell.author.text = detailData.author;
我认为,这个:
cell.author.text.font = [UIFont systemFontOfSize:12.0];
应该是,这个:
cell.author.font = [UIFont systemFontOfSize:12.0];
因为 NSString 没有关于字体的信息(只有 body=text),你必须在显示它的对象中指定字体 - 作者。
cell.author.font = [UIFont systemFontOfSize:12.0];
cell.author.text.font = [UIFont systemFontOfSize:12.0];
将代码替换为
cell.author.font = [UIFont systemFontOfSize:12.0];
我在集合单元格中有文本。 如何更改 NSString 文本的大小?我已经尝试过类似
的方法cell.author.text.font = [UIFont systemFontOfSize:12.0];
但是不允许,它说 属性 'font' not found on object of type 'NSString'
CollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];
cell.author.text = detailData.author;
我认为,这个:
cell.author.text.font = [UIFont systemFontOfSize:12.0];
应该是,这个:
cell.author.font = [UIFont systemFontOfSize:12.0];
因为 NSString 没有关于字体的信息(只有 body=text),你必须在显示它的对象中指定字体 - 作者。
cell.author.font = [UIFont systemFontOfSize:12.0];
cell.author.text.font = [UIFont systemFontOfSize:12.0];
将代码替换为
cell.author.font = [UIFont systemFontOfSize:12.0];