मैं एक यूआईसीओलेक्शन व्यू में कई छवि कोशिकाओं को प्रदर्शित कर रहा हूं। एक बटन के साथ मैं पहले अपने सभी सेल को समूह में सक्षम करने में सक्षम होना चाहता हूं।यूआईसीओलेक्शन व्यू: एनीमेशन कस्टम लेआउट
यह अच्छी तरह से काम कर रहा है लेकिन जब मैं अपने पुनर्गठन कार्रवाई में एनीमेशन संक्रमण जोड़ने की कोशिश कर रहा हूं, तो कुछ नहीं होता है।
यहाँ विधि मैं एक कस्टम लेआउट में उपयोग करें:
- (NSArray*)layoutAttributesForElementsInRect:(CGRect)rect
{
NSArray* allAttributesInRect = [super layoutAttributesForElementsInRect:rect];
if([allAttributesInRect count] > 0 && _isRegroup)
{
UICollectionViewLayoutAttributes *firstAttribute = [allAttributesInRect objectAtIndex:0];
CGRect frame = firstAttribute.frame;
for(UICollectionViewLayoutAttributes *attribute in allAttributesInRect)
[UIView animateWithDuration:0.3f animations:^{attribute.frame = frame;}];
}
return allAttributesInRect;
}
- (void)regroupCells:(BOOL)isRegroup // This method is called from my collection controller when my button is pressed
{
_isRegroup = isRegroup;
[self invalidateLayout];
}
किसी भी विचार? धन्यवाद!
धन्यवाद! मैं समझता हूं कि यह अब कैसे काम करता है :) – Pierre
यहां उन लोगों के लिए परिणाम है जो देखना चाहते हैं :) http://d.pr/v/QUTF (मुझे एक गड़बड़ समस्या है) – Pierre
आपको "शीर्ष" के लिए जेड इंडेक्स बढ़ाने की जरूरत है "स्टैक में आइटम, आप फ्रेम को एडजस्ट करते समय उसी स्थान पर कर सकते हैं। – jrturton