uitableview – tableView backgroundView在iOS7中不起作用

uitableview – tableView backgroundView在iOS7中不起作用,第1张

概述我正在设置一个视图作为uitableview的背景. View只有colorWithPattern Image. 它在iOS6中正常工作,但在iOS7中,它没有任何效果,TableView背景在iOS7中仍然只是白色.我正在使用Three20库. 我的代码是 UIImage *imgBackGround = [UIImage imageNamed: @"my_background.png"];s 我正在设置一个视图作为uitablevIEw的背景. VIEw只有colorWithPattern Image.

它在iOS6中正常工作,但在iOS7中,它没有任何效果,tableVIEw背景在iOS7中仍然只是白色.我正在使用Three20库.

我的代码是

UIImage *imgBackGround = [UIImage imagenamed: @"my_background.png"];self.tableVIEw.backgroundcolor = [UIcolor clearcolor];UIVIEw *backVIEw = [[UIVIEw alloc] initWithFrame:self.vIEw.frame];[backVIEw setBackgroundcolor:[UIcolor colorWithPatternImage:imgBackGround]];self.tableVIEw.backgroundVIEw = backVIEw;[backVIEw release];self.vIEw.backgroundcolor=[UIcolor colorWithPatternImage:imgBackGround];

在iOS7中会出现什么问题?
请帮助,提前致谢.

解决方法 在iOS 7中,tablevIEw的单元格自动具有白色背景颜色.您需要清除单元格的颜色和背景.

cell.backgroundcolor = [UIcolor clearcolor];cell.backgroundVIEw =  [UIVIEw new];

在cellForRowAtIndexPath中使用

这肯定会解决它.

总结

以上是内存溢出为你收集整理的uitableview – tableView backgroundView在iOS7中不起作用全部内容,希望文章能够帮你解决uitableview – tableView backgroundView在iOS7中不起作用所遇到的程序开发问题。

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

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

原文地址: https://www.outofmemory.cn/web/1069031.html

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

发表评论

登录后才能评论

评论列表(0条)

保存