मेरे पास छवियों के साथ एक UIScrollView है और जब उपयोगकर्ता स्क्रॉलव्यू के अंत तक स्क्रॉल करता है तो मैं सामग्री को अपडेट करना चाहता हूं।UIScrollview नीचे पता चला
कोड नीचे scrollViewDidScroll:
प्रतिनिधि में कार्यान्वित किया जाता
CGFloat scrollViewHeight = imagesScrollView.bounds.size.height;
CGFloat scrollContentSizeHeight = imagesScrollView.contentSize.height;
CGFloat bottomInset = imagesScrollView.contentInset.bottom;
CGFloat scrollViewBottomOffset = scrollContentSizeHeight + bottomInset - scrollViewHeight;
if(imagesScrollView.contentOffset.y > scrollViewBottomOffset){
[imagesView addSubview:imagesBottomLoadingView];
[self downloadImages];
}
मेरे समस्या है कि तह तक उपयोगकर्ता स्क्रॉल, मेरे समारोह कई कहा जाता है जब यह पता लगाने के लिए जब scrollview के नीचे तक पहुँच जाता है मेरी कोड है बार, लेकिन मैं इसे केवल एक बार कॉल करना चाहता हूं। मैं imagesScrollView.contentOffset.y == scrollViewBottomOffset साथ की कोशिश की लेकिन यह काम नहीं करता और समारोह
अतिरिक्त कॉल को फ़िल्टर करने, उदाहरण के लिए, एक शर्त झंडा जोड़े की तरह अगर (imagesView बच्चे imagesBottomLoadingView है) – xfx
ठीक है, यह इतना आसान था, लेकिन मैं इस बारे में सोच नहीं किया। धन्यवाद! – lubilis