हे, क्या कोई मुझे इस माध्यम से मार्गदर्शन कर सकता है मेरे पास तालिका में लगभग 15 प्रविष्टियां हैं I पिछले 15 में अंतिम UITableViewCell में लोड के साथ आने के लिए 15 अन्य पसंद करेंगे। क्या कोई मेरी मदद कर सकता है?uitableviewcell में "अधिक लोड करें" बटन बना रहा है?
उत्तर
tableview में एक अतिरिक्त पंक्ति को दिखाने के लिए,
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return dataRows+1;
}
में
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
//after setting tableviewcell
if(indexPath.row==dataRows){
[email protected]"Load More Rows";
}
}
में
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.row==dataRows){
//there you can write code to get next rows
}
}
में आप प्रदर्शित पंक्तियों के अनुसार चर numberOfRows अपडेट करना होगा।
संपादित करें: अतिरिक्त प्रविष्टियों को लाने के बाद, आप उन्हें निम्न विधि का उपयोग कर मौजूदा प्रविष्टियों सरणी में जोड़ सकते हैं। इस विधि का उपयोग करने के लिए आपकी मूल सरणी NSMutableArray
होना चाहिए।
[originalEntriesArray addObjectsFromArray:extraEntriesArray];
@ श्रीप्रिया, इसे जोड़ें लाइन 'संख्याऑफरो = [yourEntriesArray गिनती] + 1; 'इसे और स्पष्ट करने के लिए। – EmptyStack
@ सिमॉन: नमस्ते .., मैंने कोड – SriPriya
@SriPriya, Hmmm :) – EmptyStack
आशा है कि यह
मैं एक परिवर्त्य सरणी और एक पूर्णांक चर लिया और पूर्णांक चर
arr = [[NSMutableArray alloc]initWithObjects:@"Radix",@"Riki", nil]; dataRows = [arr count];
और उसके बाद मैं संख्या निर्धारित करने वालों की कुल संख्या सेट में मदद करता है तालिका
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return dataRows+1; }के डेटासोर्स विधि में पूर्णांक चर के अनुसार खंडों में पंक्तियों में से 210
क्योंकि आप अंत में एक अतिरिक्त सेल चाहते थे।
अब अपने समय
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ स्थिर NSString * CellIdentifier = @ "सेल" तालिका सेल का पाठ सेट करने के लिए;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
//setting the text of the cell as per Mutable array
if (indexPath.row < [arr count]) {
cell.textLabel.text = [arr objectAtIndex:indexPath.row];
}
//setting the text of the extra cell
if (indexPath.row == dataRows) {
cell.textLabel.text = @"more cells";
}
return cell;
}
अब और अधिक कोशिकाओं सेल के हिट परआप अतिरिक्त कोशिकाओं सही तो बस
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
विधि के अंदर अपना कोड जोड़ना चाहते हैं, मतलब है कि आप कुछ इस तरह करना है
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.row == dataRows) { //code for exra cells please } }
इस कोड को देखने के लिए अपने ऐप को चलाएं।
मैंने एक उदाहरण प्रोजेक्ट लिखा जो यह करता है। GitHub https://github.com/Abizern/PartialTable
मुझे 'startUpdate' और' endUpdate' का उपयोग करके तालिका दृश्य को अपडेट करने का हिस्सा पसंद है –
से डाउनलोड मैं कुछ है कि उपयोगी हो सकता है लिखा है: https://github.com/nmondollot/NMPaginator
यह पृष्ठांकन समाहित है, और काफी किसी भी पेज और per_page मानकों का प्रयोग करके वेब सेवा के साथ काम करता है। जब आप नीचे स्क्रॉल करते हैं तो अगले परिणामों के स्वचालित फ़ेचिंग के साथ इसमें UITableView भी शामिल है।
- 1. केकेपीएचपी रेडियो बटन बना रहा है
- 2. कस्टम UITableViewCell बटन कार्रवाई?
- 3. बैकबोनजेएस: संग्रह में अधिक आइटम लोड करें
- 4. UITableViewCell
- 5. UITableViewCell विस्तृत/संक्षिप्त करें एनिमेशन (काम करता है जब विस्तार हो रहा है, लेकिन गिर नहीं)
- 6. uitableviewcell में गतिशील रूप से बटन जोड़ना - आईफोन ऐप
- 7. UITableViewCell
- 8. UITableViewCell
- 9. एक बार से अधिक डीएलएल लोड करें?
- 10. UITableViewCell
- 11. लोड हो रहा है स्क्रिप्ट
- 12. UITableViewCell
- 13. UITableViewCell में हटाने के लिए स्वाइप करें सफेद पृष्ठभूमि है,
- 14. UITableViewCell
- 15. UITableViewCell
- 16. UITableViewCell में पाठ छाया निकाला जा रहा है जब यह
- 17. UITableViewCell
- 18. लोड हो रहा है ExtJS
- 19. जावास्क्रिप्ट बटन पर एक पेज लोड करें
- 20. छुपाएं/दिखा रहा है UITableViewCell सहायक डिस्क्लोजर संकेतक
- 21. UITableViewCell सबक्लास
- 22. UIButton UITableViewCell
- 23. सूची बॉक्स परिणामों के नीचे "अधिक लोड करें" बटन कैसे जोड़ें?
- 24. Hirb - "बहुत अधिक क्षेत्रों .." केवल जब irbrc से लोड हो रहा है (कंसोल में नहीं सीधे)
- 25. लेज़ी लोड हो रहा है
- 26. हाइबरनेट में कई से अधिक संग्रह आलसी कैसे लोड करें?
- 27. UITableViewCell
- 28. मैं एक परिवर्तनीय आकार UITableViewCell कैसे बना सकता हूं?
- 29. प्रतिनिधि UITableViewCell
- 30. UITableView संख्या में निर्दिष्ट की तुलना में अधिक पंक्तियों को दिखा रहा है OfRowsInSection:
UITableView में ["अधिक लोड करें" के संभावित डुप्लिकेट] (http://stackoverflow.com/questions/4410257/) या ["लोड 25 अधिक" को कैसे कार्यान्वित करें] (http://stackoverflow.com/questions/ 2801069 /) या [मेल ऐप अधिक संदेश लोड करें] (http://stackoverflow.com/questions/4396464/) या [आईफोन में अधिक रिकॉर्ड लोड करें] (http://stackoverflow.com/questions/4965919/) या [जोड़ें तालिका दृश्य के लिए अधिक विकल्प लोड करें] (http://stackoverflow.com/questions/5898399/) [अन्य] के बीच (http://stackoverflow.com/search?q=iphone+load+more) –