मैं अपनी तालिका चाहता हूं कि इस मामले में "उदाहरण" में टेक्स्ट के साथ 6 पंक्तियां दिखें। जहां तक मैं कह सकता हूं, मेरे पास numberOfSectionsInTableView:
और numberOfRowsInSection:
ठीक से सेट है। नीचे दिए गए उदाहरण कोड देखें:UITableView संख्या में निर्दिष्ट की तुलना में अधिक पंक्तियों को दिखा रहा है OfRowsInSection:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
// Return the number of rows in the section.
return 6;
}
- (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];
}
cell.textLabel.text = @"Example";
return cell;
}
समस्या यह है कि जब आप पंक्तियों को नहीं/अस्तित्व में नहीं है चाहिए के लिए लाइनों दिखा नीचे छवि देखें।
कैसे मैं पिछले पंक्ति 6 दिखा लाइनों से छुटकारा मिलता है?
इस से स्क्रॉल करने के लिए की जरूरत है कम पंक्तियां के साथ सभी सादे तालिका विचारों के डिफ़ॉल्ट व्यवहार है, तो बस पंक्तियों और वर्गों की संख्या निर्धारित करने से मदद नहीं मिलेगी। आपको एक और तरीका खोजने की आवश्यकता होगी ... – BoltClock