2011-10-28 7 views
1

iPad AppのUISplitViewControllerの左側にあるナビゲーションテーブルのセルに、ある種のアイコン/イメージを割り当てることができるかどうかを知りたいと思います。ハウツーですか? UISplitViewController TableCell Image

1 ...

http://www.cre8ive.kr/blog/wp-content/uploads/SplitViewTest_03.png

を行に次の画像は、私が

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; 

メソッドを編集して、このアプローチをしようとしています。

は、ここで私は

// Customize the appearance of table view cells. 
- (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];  
    } 
    cell.textLabel.text = [NSString stringWithFormat:@"%i", indexPath.row +1]; 
    //Let the magic happen here :D 
    UIImage *image = [UIImage imageNamed:@"deviantart_dark.png"]; 
    //Nothing changes :(
    [[cell imageView] setImage:image]; 
    return cell; 
} 

任意のアイデアを得たものは?あなたは以下のコードを使用することができます

答えて

0

cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage:imageNamed:@"deviantart_dark.png"]]; 
+0

ここでそれをしようと試みとは、結果 http://mbdesigns.de/Bildschirmfoto%202011-10-28%20um%2007.39.55.png Iでありますセルサイズにフルサイズの背景画像を使用しようとしましたが、同じように見えました。 私はappleがsplitviewcontrollerのナビゲーションにあるアイコンを許可しているとは思っていません:( –

+0

あなたは確かにそうしていますが、あなたが使ったコード全体を投稿することはできますか?テキストラベル。 – sElanthiraiyan

+0

それは仕事をしましたが、まだ問題があります... 私がセルをクリックすると、背景が消えます(アイコン/画像のように)が見えなくなります... 背景を設定する方法はありますか細胞の活性状態のために? –

関連する問題