2012-05-15 70 views

回答

1

@property(nonatomic)NSInteger indentationLevel屬性定義din UITableViewCell documentation。使用這個你可以設置tableview Cell的縮進級別。設置此屬性從您的- (void)willTransitionToState:(UITableViewCellStateMask)state

1

你可以在你的UITableViewCell子類實現

- (void)willTransitionToState:(UITableViewCellStateMask)state 

稍微移動你的子視圖,以便有更大的填充。

0

設置indentationLevel/indentationWidth不適用於我。

什麼工作對我來說是子類的UITableViewCell和定製-layoutSubviews

#define LEFT_EDITING_MARGIN 42 

- (void)layoutSubviews 
{ 
    [super layoutSubviews]; 

    if (self.editing && self.contentView.frame.origin.x != 0) { 
     CGRect frame = self.contentView.frame; 
     CGFloat diff = LEFT_EDITING_MARGIN - frame.origin.x; 
     frame.origin.x = LEFT_EDITING_MARGIN; 
     frame.size.width -= diff; 
     self.contentView.frame = frame; 
    } 
} 
+0

謝謝 - 其他建議並沒有爲我工作,要麼。 –

相關問題