2015-10-14 76 views

回答

2

讓我們假設你的分享按鈕是在左邊的按鈕陣列中。在該方法中:

- (void)swipeableTableViewCell:(SWTableViewCell *)cell scrollingToState:(SWCellState)state 
{ 
    //case:left buttons opened  
    UIButton *shareButton = leftButtonsArray[theIndexOfTheShareButton]; 
    shareButton.enabled = NO; 
} 
1

@karthikeyan您可以通過下面的代碼隱藏在tableview中特定行按鈕:

- (void)updateRightUtilityButtons:(NSArray *)rightUtilityButtons WithButtonWidth:(CGFloat) width { 
_rightUtilityButtons = rightUtilityButtons; 

[self.rightUtilityButtonsView updateUtilityButtons:rightUtilityButtons WithButtonWidth:width]; 

[self.rightUtilityButtonsView layoutIfNeeded]; 
[self layoutIfNeeded]; 
} 

添加/更新此方法SWTableViewCell.m類,其中rightUtilityButtons是你需要顯示按鈕的數組特定的行。

在情況下,如果要僅禁用用戶交互,同時添加按鈕進入陣列就可以實現,僅通過shareButton.userInteration = NO禁用該按鈕的用戶交互,然後添加到數組中,然後將數組傳遞到以上定義的方法。通過這個,你可以確定這個按鈕被禁用。

但請提供您已經工作的示例代碼,以便可以直接更新您的代碼。

如果你仍然沒有得到恢復,我會直接在這裏給你工作代碼。

+0

謝謝..我用LoVo做了這個回答 – karthikeyan

+0

酷,快樂編碼:) –