【问题标题】:How to set UITableView cell alpha?如何设置 UITableView 单元格 alpha?
【发布时间】:2023-04-06 21:27:01
【问题描述】:

我必须将单元格的 alpha 设置为最小值。我在行的单元格中尝试以下代码,它不起作用。 我也设置了不透明,但它仍然无法正常工作。有人对此有任何想法吗?

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) 
{
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
cell.alpha =0.5;

【问题讨论】:

标签: iphone objective-c ios uitableview


【解决方案1】:

试试这个..

cell.contentView.alpha = 0.5;

【讨论】:

  • contentView 这是主要的事情
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多