छोटी चाल का उपयोग करके देखें:
बस सेल के अल्फा सेट करें। अपनी शर्तों के अनुसार कुछ शर्त रखें और अल्फा सेट करें।
cell.alpha=0.2;
यदि यह काम नहीं करता है, तो आप इसे पसंद करते हैं, तो दूसरी चाल का उपयोग करें,
बस ट्रांसपेरेंट बैकग्राउंड के साथ सेल बैकग्राउंड वाले सेल साइज की एक इमेज लें, बस उस इमेज को सेल कंटेंट के ऊपर इमेज में जोड़ें। इस कदर:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
if(indexPath.row==0)
{
cell.userInteractionEnabled=FALSE;
UIImageView *img=[[UIImageView alloc]init];
img.frame=CGRectMake(0, 0, 320, 70);
img.image=[UIImage imageNamed:@"DisableImage.png"];
img.backgroundColor=[UIColor clearColor];
[cell.contentView addSubview:img];
[img release];
}
else {
//Your usual code for cell interaction.
}
return cell;
}
हालाँकि मैं रास्ते के बारे में निश्चित नहीं हूँ, लेकिन यह निश्चित रूप से आपकी आवश्यकता को पूरा करेगा। यह उपयोगकर्ता के मन में एक प्रकार का भ्रम देगा कि सेल अक्षम है। बस इस समाधान का उपयोग करने का प्रयास करें। जो आपकी समस्या का समाधान करेगा।
cell.userInteractionEnabled = cell.textLabel.enabled = cell.detailTextLabel.enabled = NO;