2012-08-06 85 views
0

我在我的應用程序中使用具有靜態表視圖作爲選項面板的UITableViewController。我有一個背景圖像,顯示了一個圓形的邊框面板,我想將靜態單元格放在此圖像中。不幸的是,它看起來不可能設置單元格寬度,並且表格試圖獲得儘可能多的空間。單元格寬度在靜態UITableView

我該如何解決?

非常感謝

克勞斯

回答

0
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *CellIdentifier = @"Cell"; 
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 
    cell.selectionStyle = UITableViewCellSelectionStyleNone; 
    cell.textLabel.font = [UIFont boldSystemFontOfSize:16]; 

    //cell background image 
    UIImageView *backgroundView = [[UIImageView alloc] initWithFrame:CGRectZero]; 
    cell.backgroundView = backgroundView; 
    backgroundView.image = [UIImage imageNamed:@"backgroundimage.png"]; 

    return cell; 
}