-1
我有分組uitableview的設計問題,我將uiviews添加到每個單元格的最左邊,延伸的單元格邊界很少,我希望它們被剪裁。但是在IB中設置剪輯子視圖和在代碼中設置clipsToBounds屬性都沒有幫助。分組樣式UITableView不會剪裁子視圖
到目前爲止,我還設置clipsToBounds(兩者的UITableView本身和個人uitabviewcells)在許多地方,但沒有幫助:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
...
[cell setClipsToBounds:TRUE];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:defaultIdentifier];
if (cell == nil)
{
cell = [self reuseTableViewCellWithIdentifier:defaultIdentifier withIndexPath:indexPath];
}
...
[cell setClipsToBounds:TRUE];
...
return cell;
}
- (void)viewDidLoad
{
...
[mainTableView setClipsToBounds:TRUE];
}
是否有可能在不改變的tableview風格平淡?
Try cell.contentView.clipsToBounds = YES; (這是一個猜測) – danh 2013-03-07 00:21:26
有截圖嗎? 「單元格」是表格的全部寬度(即,它包括左/右的灰色位)。 – 2013-03-07 00:24:18