LoginSignup
5
5

More than 5 years have passed since last update.

UITableViewCellを、iPadでも透過する

Posted at

散々既出ですが、UITableViewCellを透過しようとしてハマったのでメモ。
iPhoneシミュレータやiPhoneではStoryboardだけで透過されたが、
少なくともiPadシミュレータでは透過されなかった。iPad実機は未検証。

MyTableViewController.swift
class MyTableViewController: UITableViewController {
    override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
        cell.backgroundColor = .clearColor()
    }
}

もちろん、cellForRowAtIndexPathの中で透過処理しても良いが、ここで一括処理するのが吉。


既出です

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5