私は(レンダリングされた)UITableViewCell *メソッドを持っています。私は、セル全体の幅/フレームを知りたいです。UITableViewCell全体の幅/フレームを取得する
cell.frame
は動作していないようです - それは私にランダムなセルのフレームを与えます。私が得た最も近いものはcell.contentView.frame
ですが、accessoryView
(http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7参照)の対象となる領域は含まれていません。 cell.contentView.superview.frame
はどちらも動作しません - ちょうどcell.frame
のような任意の場所にフレームを与えます。アクセサリビューは、私はすべてのケースでUITableViewCell
のフレーム全体/幅を得ることができる方法UITableViewCellAccessoryNone
任意のアイデアである場合を除いて
cell.contentView.width
+ cell.accessoryView.width
作品?
はい、幅/高さが正確です。しかし、cell.offsetはすべてうんざりです - どんな考えですか? – psychotik
これを試してください。オフセット。cell.frame.x、cell.frame.y – DShah
これは 'cell.frame.origin.x'、' cell.frame.origin.y'です。 – Sisu