ios – 如何为UITableView中的Index Bar部分设置透明背景?

ios – 如何为UITableView中的Index Bar部分设置透明背景?,第1张

概述如何在UITableView中为部分索引栏设置透明背景? 我试过了: tableView.sectionIndexBackgroundColor = .clearColor() 但酒吧的背景为浅灰色 编辑 我试图改变tableview的背景颜色,但它似乎没有影响. tableView.backgroundView = UIView.init() tableView.backgroundColo 如何在UItableVIEw中为部分索引栏设置透明背景?

我试过了:

tableVIEw.sectionIndexBackgroundcolor = .clearcolor()

但酒吧的背景为浅灰色

编辑
我试图改变tablevIEw的背景颜色,但它似乎没有影响.

tableVIEw.backgroundVIEw = UIVIEw.init()  tableVIEw.backgroundcolor = .blackcolor() // trIEd .clearcolor() too.

EDIT2

tableVIEw.sectionIndexBackgroundcolor = UIcolor(white: CGfloat(1.0),Alpha: CGfloat(0.5)) // change the Alpha and check once

我也尝试过使用Alpha值的颜色.我可以使背景半透明(参见上面的行代码).但是,如果我将Alpha设置为0.0以使其完全透明,我将再次获得浅灰色背景.

解决方法 tableVIEw.sectionIndexBackgroundcolor = .clear完美无缺

总结

以上是内存溢出为你收集整理的ios – 如何为UITableView中的Index Bar部分设置透明背景?全部内容,希望文章能够帮你解决ios – 如何为UITableView中的Index Bar部分设置透明背景?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1002276.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存