0
我面臨的一個小問題,EM敲我的頭是不能夠解決它......的UITableViewCell重複的UIView
我有一個UITableView
與定製UITableViewCell
..細胞的高度上文字的大小確定。當用戶點擊它時,文本會被翻譯,並且翻譯後的文本會被添加到新行中。爲使他們看起來分開,我寬度增加UIView lineView
不亞於細胞的標籤和height = 1
UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(bubbleFrame.origin.x, bubbleFrame.origin.y + bubbleFrame.size.height/2, bubbleFrame.size.width, 1)];
lineView.backgroundColor = [UIColor whiteColor];
lineView.tag = indexPath.row;
[cell addSubview:lineView];
一切工作正常,但是當我返回到該viewController
我看到lineView
錯位的每個細胞..
無法理解爲什麼它這樣做..
任何幫助,將不勝感激..在此先感謝..
如何設置單元的新高度?你能顯示heightForRowAtIndexPath方法嗎? – streem
在cellForRow中添加它之前刪除了這個UIView:Atindex? –
你可以顯示'cellForRowAtIndexPath:'方法嗎? – Akhilrajtr