0

とを表示する必要があるtableViewがありtextlabelますdetailtextlabel

ただしdetailtextlabel、表示されていません。

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
     static NSString *CellIdentifier=@"Cell";
     UITableViewCell* cell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier];

     if(cell == nil){
         cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault    reuseIdentifier:CellIdentifier]autorelease];
      }

      NSMutableDictionary *d2 =[[NSMutableDictionary alloc]initWithDictionary:[autocompleteUrls objectAtIndex:indexPath.row]];

      cell.textLabel.text = [NSString stringWithFormat:@"%@",[d2 valueForKey:@"FLName"]];
      cell.detailTextLabel.text=@"Id";
      cell.textLabel.font=[UIFont boldSystemFontOfSize:12];
      cell.textLabel.numberOfLines=0;

      return cell;
}

しかしdetailtextlabel、表示されていません、なぜですか?

4

3 に答える 3

4

UITableViewCellStyleDefaultを使用しますが、UITableViewCellStyleSubtitleを使用する必要があります

cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle    reuseIdentifier:CellIdentifier]autorelease];
于 2013-02-28T16:03:40.810 に答える
0

私は通常UITableViewCellStyleValue1この場合に使用します

[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]
于 2013-02-28T16:06:40.663 に答える
-1

あなたに詳細に答えを与えるために:

ここに画像の説明を入力してくださいここに画像の説明を入力してください

于 2013-02-28T16:49:02.330 に答える