UITableView / UITableViewCell challenge with transparent background on iPad with iOS7

前端 未结 4 1009
死守一世寂寞
死守一世寂寞 2021-01-03 18:25

Last night I decided to upgrade to Xcode 5 and take a look at my current project. After updating my storyboards to the new UI everything looked great and ran fine. Since I

4条回答
  •  甜味超标
    2021-01-03 18:57

    After wasting multiple hours with interface builder, I'm thinking that there might be a bug there. So I started to look for a programatic answer. Apparently had I started here I could have saved a ton of time. By adding to the method:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    

    I was able to solve the transparency issue on iPad by adding this one line:

    cell.backgroundColor = [UIColor clearColor];  // Adding this fixes the issue for iPad
    

    Hope this helps everyone else with the white background seen for ipad with tables and iOS7!

提交回复
热议问题