gpt4 book ai didi

ios - 如何获得透明的表格 View

转载 作者:行者123 更新时间:2023-12-01 16:45:47 25 4
gpt4 key购买 nike

关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。












想改进这个问题?将问题更新为 on-topic对于堆栈溢出。

8年前关闭。




Improve this question




我们可以让 table view 透明,以便放回 table view 的图像可见吗?

我希望表格单元格看起来透明。

最佳答案

要在代码中将某个 UI 元素设置为透明,您可以设置 backgroundColor[UIColor clearColor] .

您可以在以下位置创建单元格时实现它:

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyIdentifier"];
}
cell.backgroundColor = [UIColor clearColor];
return cell;
}

关于ios - 如何获得透明的表格 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20043548/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com