2012-11-04 24 views
0

我有一個tableview作爲我的應用程序的菜單。我想最後一個單元格是3個按鈕,它們類似於被分成3個部分的單元格。國家地理應用程序不正是我要找的:最後的UITableViewCell分成3個按鈕

enter image description here

我怎樣才能獲得最後一個單元格類似於此做什麼(有三個0的區域)?任何幫助將是偉大的!謝謝!

回答

1

只需在您的最後一個單元格中添加三個帶有按鈕的UIViews。在你的方法:

cellForRowAtIndexPath 

創造標識,一個簡單的細胞,一個用於最後一個單元格:

static NSString *SimpleCellIdentifier = @"simpleCell"; 
static NSString *LastCellIdentifier = @"lastCell"; 

做一個條件:

if(indexPath.row == lestIndexCell) { 
    //create last cell with "lastCell identyfier", and add subviews 
    [cell addSubview:buttonView1]; 
    [cell addSubview:buttonView2]; 
    [cell addSubview:buttonView3]; 

} else { 
    //create last cell with "simpleCell identyfier" 
+0

這個偉大的工程!謝謝!如何禁用最後一個單元格,以便我可以點擊自定義視圖?再次感謝! –

相關問題