-1
這是我的代碼「的UITableViewCell」不顯示標籤
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];}
self.credits = (UILabel*)[cell viewWithTag:101];
self.credits.text = @"Available Credits";
cell.backgroundColor = [UIColor redColor];
self.credits.textColor = [UIColor blackColor];
[cell.contentView addSubview:self.credits];
學分是這裏的標籤
是你的self.credits零? –
你可以顯示'self.credits' –
你在哪裏分別創建'UILabel'標籤101分配給標籤? – vadian