iOS 教學, iOS進階

內含動態高度文字區塊的 TableViewCell 新舊作法

舊作法(iOS7以前) 在 iOS7(含)之前,內含動態高度文字區塊(UITextView)的 UITableViewCell 的作法頗為複雜: 1. 使用 Auto Layout,將TextView四邊邊界設為0 2. 在 cellForRowAtIndexPath 裡回傳 cell 到這裡與一般程式並沒有什麼不同。 – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { OldDynamicCell *cell =