开发者

How to set color in empty UITableViewCell?

开发者 https://www.devze.com 2023-03-16 09:54 出处:网络
I want to replicate Gow开发者_开发知识库alla UI of the detail part (the table with Map & Directions) picture below

I want to replicate Gow开发者_开发知识库alla UI of the detail part (the table with Map & Directions) picture below

How to set color in empty UITableViewCell?

I replicate it with a table with a contentInset, set backgroundColor to clearColor, and change color of UITableViewCell in - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath to white, but the result isn't what I expected the empty cells are white only the cells with content (a number return by - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section ) here is a result I got

How to set color in empty UITableViewCell?

Is there any way to set empty cell color or any guide on how to achieve this ?


Set background color of view same as you are setting for your cell. and make cell transparent.


Due to no response for long time I would posted my solution here. I solved this problem by having UITableView under UIView and set parent view background color the same as UITableViewCell color.

0

精彩评论

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