मैं अपने प्रोजेक्ट में "हटाने के लिए स्वाइप करें" विकल्प का उपयोग करना चाहता हूं।UITableView समस्याओं में विकल्प हटाने के लिए स्वाइप करें
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
NSDictionary *userData = [_contactsArray objectAtIndex:indexPath.row];
NSLog(@"delete row %@",userData);
}
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
मैं इस कोड का उपयोग कर रहा हूं लेकिन यह निम्नलिखित आउटपुट देता है जो मैं नहीं चाहता हूं।
मैं नहीं चाहता कि बाईं ओर शून्य पर साइन साइन करें। मैं बस स्वाइप करना चाहता हूं और हटाएं बटन दिखाएं। वही कोड मैंने अपने पिछले प्रोजेक्ट में उपयोग किया है और यह ठीक काम करता है (यानी केवल डिलीट बटन दिखाने के लिए स्वाइप करें, बाएं तरफ कोई शून्य चिह्न नहीं)
कृपया इसे हल करने में मेरी सहायता करें।
http://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/occ/instp/UITableViewCell/shouldIndentWhileEditing – Kevin
http://stackoverflow.com/प्रश्न/3020 9 22/किसी भी तरह से-छिपाने-हटाने-बटन-जबकि-संपादन-uitableview – Rushabh
आप सही UITableViewDelegate विधियों को ओवरराइड कर रहे हैं। लेकिन क्या आप अपने यूआईटीबल व्यू की 'संपादन' संपत्ति को अपने कोड में कहीं भी 'YES' पर सेट कर रहे हैं? यदि ऐसा है, तो इससे लाल ऋण संकेत दिखाई दे सकते हैं। – hgwhittle