简体   繁体   English

使用图像作为UITableView分隔符

[英]Use an image as the UITableView separator

I got an UITableView on my project and I need to customize the separator. 我的项目上有一个UITableView,我需要自定义分隔符。 I want to use an image instead of a color. 我想使用图像而不是颜色。 I tried using the +colorWithPatternImage: UIColor method with no luck. 我尝试使用+ colorWithPatternImage:UIColor方法没有运气。

use this code i use it in my application this will work 使用此代码我在我的应用程序中使用它将工作

UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image name"]];
[self.tableview setSeparatorColor:color];

As far as I know you can't. 据我所知你不能。 What you can do however is to set the separator to none and then add the image you want to use as a separator to the cell view. 但是,您可以将分隔符设置为none,然后将要用作分隔符的图像添加到单元格视图中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM