Tôi có dạng xem bảng được gọi là todoTableView
với các ô do người dùng tạo. Mỗi ô có Chế độ xem văn bản. Tôi muốn thay đổi chiều cao của ô theo nội dung của Chế độ xem văn bản. Đây là những gì tôi đã cố gắng:Thay đổi chiều cao ô theo nội dung của textView bên trong ô
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell: TableViewCell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath:indexPath) as! TableViewCell
cell.bounds.size.height = cell.textView.bounds.size.height
return cell
}
Bạn đang sử dụng tính năng tự động trả lời? – Irfan
Xem [câu hỏi này] (http://stackoverflow.com/questions/14956189/calling-heightforrowatindexpath-from-within-cellforrowatindexpath). –
@Irfan Có. Phoen1xUK - Tôi không biết Mục tiêu-C – Eliko