2011年7月6日

[iPhone] cell的選中樣式


要怎麼設定cell的被選中樣式呢?
在default的設定中,cell被選中會呈現藍色,
就像這樣:


UITableViewCell中有一個屬性叫做selectionStyle可以指定這個cell被選中要呈現哪一種樣式,


如果我們指定:
cell.selectionStyle = UITableViewCellSelectionStyleNone;
就會長這樣:


如果我門指定:
cell.selectionStyle = UITableViewCellSelectionStyleGray;
就會長這樣: