2010-07-09 50 views

回答

1

您不能增加單元格的距離,但是您可以做的是子類UITableViewCell,覆蓋-layoutSubviews,並重新定位所有內部視圖以允許在單元的一個(或兩個)末端添加一點填充。

這就是說,我想不出有一個像這樣的單元格填充的iPhone上的單個應用程序。在做這件事之前,你應該仔細考慮,因爲它非常不規範。

+0

u能幫助我如何將圖像添加到導航條或添加該圖像就地... – 2010-07-10 14:59:30

+0

的UIImage * buttonExampleImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@「imageName」] ofType:@「png」]]; \t UIButton * buttonExmaple = [UIButton buttonWithType:UIButtonTypeCustom]; \t \t [buttonExmaple setImage:buttonExampleImage forState:UIControlStateNormal]; \t [buttonExmaple addTarget:self action:@selector(ButtonEvent :) forControlEvents:UIControlEventTouchUpInside]; \t \t \t self.navigationItem.rightBarButtonItem = buttonExmaple; – 2010-07-15 10:43:52

0

+1你不能增加細胞距離。然而,你可以讓它看起來如此:定製單元格很容易在IB中製作,而好的定製單元格在黃金中的價值也很大。您可以在單元格中創建兩個UIImageView(或帶有下劃線的厚底字符串的標籤)以將單元格間隔符設置爲none和期望的高度,以創建單元格邊界的錯覺。

這裏是定製單元一個很好的教程(我建議看屏幕播): http://icodeblog.com/2009/05/24/custom-uitableviewcell-using-interface-builder/

相關問題