iphone - Label in UITableViewCell blocking background -


मुझे अपने UITableViewCell पृष्ठभूमि छवि को अवरुद्ध करने के अंदर लेबल के साथ एक समस्या हो रही है ऐसा लगता है जैसे कि यह केवल अचयनित राज्य पर होता है मैंने पृष्ठभूमि रंगों को साफ़ करने की कोशिश की, लेकिन ऐसा नहीं किया। यह तालिका दृश्य पृष्ठभूमि रंग को अपनाने है क्या मुझे लेबल पृष्ठभूमि छवि भी सेट करनी है?

  // इन में से कोई भी काम नहीं किया ... सेल.टेक्स्ट लैबेल। बैकग्राउंड कॉलेयर = [UIColor clearColor]; Cell.contentView.backgroundColor = [UIColor स्पष्ट कॉलर];  

स्क्रीन शॉट

यह मेरा < Code> cellForRowAtIndexPath

  - (UITableViewCell *) तालिकादृश्य: (UITableView *) तालिका दृश्य सेलफ़ोरोअटइंडपैथ: (NSIndexPath *) सूचकांकपथ {UITableViewCell * सेल = [तालिकादृश्य dequeueReusableCellWithIdentifier: @ "SimpleTableIdentifier"] ; यदि (सेल == नीला) {सेल = [[[यूआईटीबल वीआईएसीएल आलोक] इनिटविथफ्रेम: सीजीआरसीएक्सएआरयूआरयूईयूआईएडेंटिफायर: @ "सिंपल टेबलआईडेंटिफायर"] ऑटोरेक्लेज]; } UIImage * image = [UIImage imageNamed: @ "TableRow.png"]; UIImageView * imageView = [[UIImageView alloc] initWithImage: छवि]; ImageView.contentMode = UIViewContentModeScaleToFill; Cell.backgroundView = imageView; [छवि देखें रिलीज़]; UIImage * छविसियंत्रित = [UIImage imageNamed: @ "TableRowSelected.png"]; UIImageView * imageView चुनी गई = [[UIImageView alloc] initWithImage: छवि सेलेक्टेड]; ImageViewSelected.contentMode = UIViewContentModeScaleToFill; Cell.selectedBackgroundView = imageView चयनित; [ImageView चयनित रिलीज]; Cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; Cell.textLabel.textcolor = [UIColor whiteColor]; Cell.textLabel.text = [[self.trivia.questionsets objectAtIndex: indexPath.row] valueForKeyPath: @ "शीर्षक"]; रिटर्न सेल; }  

UPDATE : किण्डा का हल ...

अगर मैं तालिका का पृष्ठभूमि रंग सेट करता हूं (जो मैंने ग्रहण किया था वह सब कुछ के नीचे होगा ) को साफ़ करने के लिए, तब मेरी इमेज से अचानक मेरी उम्मीद है कि मैं कहाँ की उम्मीद करता हूं, लेकिन टेबल की पृष्ठभूमि अब सब कुछ के ऊपर दिखाती है? क्या यह अपेक्षित व्यवहार है? (इस पर अभी तक डॉक्स की जाँच नहीं की है)

<पूर्व> tableView.backgroundColor = [UIColor redColor]; Cell.contentView.backgroundColor = [UIColor orangeColor]; Cell.textLabel.backgroundColor = [UIColor yellowColor];

स्क्रीन शॉट 2

... और समाप्त करने के लिए, अगर मैं टेबल और सेल दोनों के पृष्ठभूमि रंगों को साफ़ करने के लिए सेट करता हूं, तो हम अच्छे हैं। टेक्स्टलेबल पृष्ठभूमि का रंग कोई फर्क नहीं पड़ता।

  tableView.backgroundColor = [UIColor clearColor]; Cell.contentView.backgroundColor = [UIColor स्पष्ट कॉलर]; Cell.textLabel.backgroundColor = [UIColor yellowColor];  

स्क्रीन शॉट 3

हाँ यह व्यवहार की उम्मीद है।

आपका टेबलव्यू एक सबव्यू है जो सब कुछ के सामने बैठता है यदि तालिका दृश्य (पृष्ठभूमि) के सामने कुछ था, तो वह तालिका को अस्पष्ट करेगा।


Comments

Popular posts from this blog

iphone - How do I make a UIPickerView in a UIActionSheet -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -