2011-12-31 27 views
0

我有一個UITableView,其中我將高度設置爲大於默認值(使用heightForRowAtIndexPath。單元格中的圖像始終爲32x32,我們目前正在垂直對齊中心。 。該圖像將在電池的頂部我想是這樣的(明確設定邊界):UITableView - 將單元格圖像對齊到左上方

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {  
    static NSString *MyIdentifier = @"MyIdentifier"; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; 

    if (cell == nil) { 
     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:MyIdentifier] autorelease]; 
     cell.imageView.bounds = CGRectMake(7,7,32,32); 
    .... 
    } 
    .... 
} 

但這不起作用沒有簡單的方法,使其無需創建一個完整的自定義單元格。 ?

回答

2

看看this article here

你可以做一些漂亮的自定義修改,如果你玩的內容視圖,你只需要知道該怎麼做;)

+0

它並沒有說如何改變內置的圖像視圖,但我結束了添加我自己的圖像視圖,這很好 – nambar 2012-01-01 08:40:16