मेरे पास मेरे UITableViewCell की पृष्ठभूमि में सीमा रंग जोड़ने और छाया ड्रॉप करने के लिए निम्न कोड है। मेरी समस्या यह है कि यह कोड तालिका पर एक विशाल अंतराल का कारण बनता है।छाया और सीमाओं के कारण UITableView लगाना
कृपया मुझे बताएं कि मैं कैसे अपना कोड अनुकूलित कर सकता हूं, UITableView की अंतराल को रोक सकता हूं?
if ([cell viewWithTag:012] == nil && comment.isReply == NO) {
UIImageView *iv = [[[UIImageView alloc] initWithFrame:frame] autorelease];
[iv setImage:[UIImage imageNamed:@"paper"]];
[iv setTag:012];
[cell insertSubview:iv atIndex:0];
[iv.layer setBorderWidth:1.0];
[iv.layer setBorderColor:[[UIColor whiteColor] CGColor]];
[iv.layer setShadowColor:[[UIColor blackColor] CGColor]];
[iv.layer setShadowOffset:CGSizeMake(0, 1)];
[iv.layer setShadowOpacity:0.75];
}
else if ([cell viewWithTag:012] == nil && comment.isReply == YES) {
frame.origin.x += 35;
UIImageView *iv = [[[UIImageView alloc] initWithFrame:frame] autorelease];
[iv setImage:[UIImage imageNamed:@"paper"]];
[iv setTag:012];
[cell insertSubview:iv atIndex:0];
UIImage *arrow = [UIImage imageNamed:@"arrow"];
UIImageView *ivs = [[[UIImageView alloc] initWithFrame:CGRectMake(-12, ([cell frame].size.width/2) + ([arrow size].width/2) , arrow.size.width, arrow.size.height)] autorelease];
[cell addSubview:ivs];
[iv.layer setBorderWidth:1.0];
[iv.layer setBorderColor:[[UIColor whiteColor] CGColor]];
[iv.layer setShadowColor:[[UIColor blackColor] CGColor]];
[iv.layer setShadowOffset:CGSizeMake(0, 0)];
[iv.layer setShadowOpacity:0.75];
}
आप छाया कहां जोड़ रहे हैं? मेरा मतलब है कि क्या आप UITableView डेटा स्रोत में ऐसा करते हैं? यदि ऐसा है, तो आपको वास्तव में एक कस्टम UITableViewCell सबक्लास बनाने और वहां कस्टम यूआई करने में देखना चाहिए। –
क्षमा करें, मैंने इसे स्पष्ट नहीं किया है, यह सेलफॉररोएट इंडेक्सपैथ विधि में है। –