हालांकि यह बिल्कुल सही नहीं है, मैं आशा करता हूं कि कोई मेरे दृष्टिकोण पर सुधार कर सके। पाठ सही है (डिफ़ॉल्ट की तरह सफेद, लेकिन आप इसे बदल सकते हैं)। पृष्ठभूमि ढाल और अस्पष्टता सही नहीं है (बहुत हल्की ??) - यहां कुछ tweaking की आवश्यकता हो सकती है।
sectionheaderbackground.png यहाँ प्राप्त करें:
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
return nil;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 22; //returning 0 hides section headers
}
यह विशेष रूप से अगर उपयोगी हो सकता है: http://img5.imageshack.us/img5/6616/sectionheaderbackground.png
// Create a stretchable image that emulates the default gradient
UIImage *buttonImageNormal = [UIImage imageNamed:@"sectionheaderbackground.png"];
UIImage *stretchableButtonImageNormal = [buttonImageNormal stretchableImageWithLeftCapWidth:12 topCapHeight:0];
// Create the view for the header
CGRect sectionFrame = CGRectMake(0.0, 0.0, 320.0, 22.0);
UIView *sectionView = [[UIView alloc] initWithFrame:sectionFrame];
sectionView.alpha = 0.9;
sectionView.backgroundColor = [UIColor colorWithPatternImage:stretchableButtonImageNormal];
// Create the label
CGRect labelFrame = CGRectMake(10.0, 0.0, 310.0, 22.0);
UILabel *sectionLabel = [[UILabel alloc] initWithFrame:labelFrame];
sectionLabel.text = @"Test section label";
sectionLabel.font = [UIFont boldSystemFontOfSize:18.0];
sectionLabel.textColor = [UIColor whiteColor];
sectionLabel.shadowColor = [UIColor grayColor];
sectionLabel.shadowOffset = CGSizeMake(0, 1);
sectionLabel.backgroundColor = [UIColor clearColor];
[sectionView addSubview:sectionLabel];
[sectionLabel release];
// Return the header section view
return sectionView;
आपके उत्तर के लिए धन्यवाद! मैं कोशिश करूंगा और आपको बता दूंगा। यहां की चाल मौजूदा छवि का उपयोग पृष्ठभूमि रंग के रूप में करना है :) मैंने सोचा कि वे नाम के साथ रंग का उपयोग करते हैं: पी –
जैसा कि डेविड डी ने उत्तर दिया था, 'वापसी शून्य' सबसे मूल दिखती है। –
निश्चित रूप से, वापसी शून्य सबसे मूल दिखती है, लेकिन यह आपको पाठ रंग जैसे कुछ भी अनुकूलित करने की अनुमति नहीं देती है, जो सवाल पूछ रहा था। – dferg