के लिए कस्टम अनुभाग शीर्षक दृश्य कूल आईरिस, लाइवशेयर जैसे कुछ ऐप्स में, मैं उन्हें अपने सादे UITableView अनुभाग शीर्षक के लिए कस्टम दृश्यों का उपयोग करके देखता हूं। कस्टम दृश्य शीर्षक पट्टी को कस्टम दृश्य के साथ बदलने का कोई तरीका है?UITableView
उत्तर
अपने सेक्शन हेडर के रूप को कस्टमाइज़ करने के लिए, दो विधियां हैं जिनका आप शायद उपयोग करना चाहते हैं।
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
और
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
इन दोनों UITableView delegate protocol में पाए जाते हैं। पहला आपको अपने सेक्शन हेडर के रूप में प्रदर्शित करने के लिए एक कस्टम दृश्य बनाने देगा। दूसरा यह सुनिश्चित करता है कि आपको वह आकार मिल जाए जो आप चाहते हैं ताकि आपका विचार
विषय से थोड़ी दूर, क्यों एप्पल ने UITableViewDataSource के बजाय UITableViewDelegate में रखा। Thx – ThinkChris
@TinkChris क्योंकि उनके पास डेटासोर्स से कोई लेना देना नहीं है। – yoeriboven
- 1. UITableView
- 2. UITableView
- 3. UITableView
- 4. UITableView
- 5. UITableView
- 6. UITableView
- 7. UITableView
- 8. UITableView
- 9. uitableview
- 10. UITableView
- 11. uitableview
- 12. UITableView
- 13. UITableview
- 14. UITableView
- 15. UITableView
- 16. UITableView
- 17. UITableView
- 18. UITableview
- 19. UITableView
- 20. uitableview
- 21. UITableView
- 22. UITableView
- 23. UITableView
- 24. UITableView
- 25. UITableView
- 26. UITableView
- 27. UITableview
- 28. UITableView
- 29. UITableView
- 30. UITableView
http://stackoverflow.com/questions/12088257/uitableview-custom-header-title-view-doesnt- शो/16687039 # 16687039 –