开发者

iPhone : UITableViewCell: cell carry background color strip

开发者 https://www.devze.com 2023-01-11 09:02 出处:网络
When i used self.view.backgroundColor开发者_JAVA技巧 = [UIColor colorWithPatternImage: [UIImage imageNamed:@\"image_name.png\"]];

When i used

self.view.backgroundColor开发者_JAVA技巧 = [UIColor colorWithPatternImage: 
                                     [UIImage imageNamed:@"image_name.png"]];  

the cell carry bottom part of image and it looks like strip on view


Use the following method to set cell height exactly the same as your image's height:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

Also you might want to remove separators depending on how your image looks using the following code:

MyTableName.separatorStyle = UITableViewCellSeparatorStyleNone;
0

精彩评论

暂无评论...
验证码 换一张
取 消