開発
How to set UITableView without background
will
Usually, iOS developers were passed by well designed UIs. To make the view fixed the design, we usually set the background of some component as transparents. Some days ago , I faced a problem to set the background of UITableView, however, I tried long time to make the UITableView with the same background as the parent view.
At the beginning, I set the background color of the table view with clear color, but it didnt work.
[tView setBackgroundColor:[UIColor clearColor]];
Finally, I found that there is a default background view in the table view, so I set it nil in the viewDidLoad function, then it worked.
[tView setBackgroundView:nil];
UIImageView *cellBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"img_tablecell_bg.png"]]; [cell setBackgroundView:cellBackgroundView];</pre> [cell setBackgroundColor:[UIColor clearColor]];