【发布时间】:2015-09-30 09:28:16
【问题描述】:
我想在表格视图中有一个带有徽标和名称的标题部分。现在,我希望徽标与下面内容单元格中的图像重叠。我在下面附上了一个例子:-
这是我到目前为止所尝试的,我尝试将标题部分的大小设为(徽标 + 上下填充)的一半——这只是将徽标切成两半
我也试过 clipToBounds :-
func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 33.0
}
func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let cell = tableView.dequeueReusableCellWithIdentifier("headerCell") as! FeedTableViewHeaderCell
cell.designerNameLabel.text = "Vitamin A"
cell.designerLogoImageView.image = UIImage(named: "zeko_small")
cell.designerLogoImageView.clipsToBounds = false
cell.contentView.clipsToBounds = false
return cell
}
【问题讨论】:
-
1.标题部分与单元格重叠。 2. Header部分有透明区域。
-
你有没有尝试过?如果有,请出示代码。
标签: ios objective-c xcode swift uitableview