可能是一個簡單的問題,但我找不到答案。 當我設置我的textLabel時,它會覆蓋我在單元格的內容視圖中顯示的詳細信息披露按鈕,並通過故事板放入。現在它只顯示單元格被選中的時間。我的代碼如下所示:UITableViewCell textLabel覆蓋我的按鈕
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"accountCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
User *user = [arr objectAtIndex:indexPath.row];
// Configure the cell...
cell.textLabel.text = [user username];
return cell;
}
當我拿走cell.textLabel.text = [用戶名]時;它隨時顯示,如我所願。 任何提示?猜猜我得把一些代碼在我的按鈕...
嘗試添加if(cell == nil){cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; }代碼在UITableViewCell *單元代碼下面。 –
不,沒有成功。我認爲問題出在某種程度上的文本標籤中。我想這是一些限制問題,但不知道。 – Rhyder