在UICollectionViewCell中不调整文本大小

时间:2018-06-01 03:01:34

标签: ios swift uicollectionview

我正在尝试在单元格中放入某些文本。

enter image description here

目前我看到上面的内容,即使我设置了以下属性:

REGISTER 'udf.py' using jython as myfunc;
loadhtml = load './assignment/crawler' using PigStorage('\u0001') as (id1:chararray,url:chararray,domain:chararray,content:chararray,source:chararray,date:chararray);
loadhtml_content = FOREACH loadhtml generate content;
flatten = FOREACH loadhtml_content generate flatten(TOKENIZE(line)) as word;
group = GROUP flatten by word;
count = FOREACH group1 generate $0, COUNT($1);
log = FOREACH count GENERATE myfunc.nLog($0,$1,**<I need to return the row count of loadhtml_content here>**);

我也尝试了属性检查器,但似乎代码会通过属性检查器覆盖设置的内容。

我想要的是减少字体和包装单词(如果需要),但适合整个单元格。

2 个答案:

答案 0 :(得分:3)

您应该将cellLabel top,bottom,leading和trailing约束设置为Cell View。然后它只适合单元格视图。

如果你想要它居中,那么至少设置前导和尾随

答案 1 :(得分:1)

请将标签限制为:

  1. 导致cellview
  2. 追踪到cellview
  3. top to cellview
  4. 从底部到细胞视图
  5. 更改行数= 0(它将自动换行内容并显示在另一行中)