2010-05-13 8 views

उत्तर

11

आईओएस 6.0 के बाद से यह वास्तव में सेक्शन इंडेक्स के लिए रंग रंग को अनुकूलित करना संभव है। प्रासंगिक गुण हैं: sectionIndexColor और sectionIndexTrackingBackgroundColor

आईओएस 7 जोड़ा sectionIndexBackgroundColor जो सेक्शन इंडेक्स के लिए पृष्ठभूमि रंग निर्दिष्ट करता है जबकि स्पर्श नहीं किया जा रहा है।

1

संक्षेप में: आप फोंटनाइज और पूर्ण बैकराउंड (गोलाकार नहीं) बदल सकते हैं अधिक संभव नहीं है।

+0

आप और अधिक वास्तव में कर सकते हैं - मेरी पोस्ट देखें: http://stackoverflow.com/a/10412958/554760 – Magnus

4

शायद कुछ देर हो चुकी है लेकिन मुझे आईओएस 7 के साथ इस समस्या का सामना करना पड़ा क्योंकि मैं आपकी मदद कर सकता हूं।

@property(nonatomic, retain) UIColor *sectionIndexColor 

अब आप रंग, जबकि छुआ नहीं किया जा रहा तालिका दृश्य के खंड सूचकांक की पृष्ठभूमि के लिए उपयोग करने के लिए सेट कर सकते हैं:

iOS 7 से वहाँ एक नई विधि कहा जाता है।

एक उचित कोड iOS 6 उपयोग करने के लिए के रूप में और 7 आप:

self.friendsTableView.sectionIndexTrackingBackgroundColor = [UIColor aColor]; // background color while the index view is being touched 
if ([self.friendsTableView respondsToSelector:@selector(sectionIndexBackgroundColor)]) 
    self.friendsTableView.sectionIndexBackgroundColor = [UIColor aColor]; // background color while the index view is NOT touched at all 
2

आप शायद UITableView के appearance proxy स्थापित करने के लिए उपयोग करना चाहिए इन:

[UITableView appearance].sectionIndexColor = [UIColor myTintColor];

संबंधित मुद्दे