UITableView

...now browsing by tag

 
 

UniversalアプリでUITableViewのセルの背景がiPadだと透明にならない

木曜日, 10月 1st, 2015

Universalアプリにて、storyboardでUITableViewのセルの背景を透明に設定したのですが、iPhoneだと透明になるのに、iPadだと透明にならず白いままでした。

調べてみたところ、コードにて背景色に透明を設定することで、iPadでも透明になることがわかりました。

let cell = tableView.dequeueReusableCellWithIdentifier("contentCell", forIndexPath: indexPath)

// セルの背景を透明に設定
cell.backgroundColor = UIColor.clearColor()

return cell

iOS7かららしいですが、バグなのか仕様なのか?

【参考】
UITableView / UITableViewCell challenge with transparent background on iPad with iOS7