1
我確信我缺少一些非常簡單的東西,但我無法使其工作。在Swift中將Int更改爲CGFloat以返回heightForRowAtIndexPath tableview函數
我會嘗試更好地解釋我在做什麼來嘗試幫助別人,如果他們有同樣的問題。
這是我的函數:
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return (count * 40 + 75) as CGFloat
}
上述功能無法正常工作。感謝我收到的幫助,我發現這是這樣做的:
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return CGFloat(count * 40 + 75)
}
謝謝!
爲什麼會這樣得到downvoted?這個問題很簡潔,寫得很好 – Unome 2014-11-25 00:22:45