collectionViewFlowLayout
bir alt sınıf yaptım. Bundan sonra, aşağıdaki kod kullanmaktadır: ayıklayıcı bu hata mesajını atar yöntemi: ViewFlowLayout Tuhaf hata alıyorum
override func finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? {
let attr = self.layoutAttributesForItemAtIndexPath(itemIndexPath)
attr?.transform = CGAffineTransformRotate(CGAffineTransformMakeScale(0.8, 0.8), CGFloat(M_PI))
attr?.center = CGPointMake(CGRectGetMidX(self.collectionView!.bounds), CGRectGetMidY(self.collectionView!.bounds))
return attr
}
Ben performBatchUpdates
kullanarak toplama görünümünde öğeleri silmek
// HATA MESAJI önce onu kopyalamadan niteliğini manipüle çünkü hata oluşur
2015-08-02 12:39:42.208 nameOfMyProject[1888:51831] Logging only once for UICollectionViewFlowLayout cache mismatched frame 2015-08-02 12:39:42.209 nameOfMyProject[1888:51831] UICollectionViewFlowLayout has cached frame mismatch for index path {length = 2, path = 0 - 11} - cached value: {{106.13333333333333, 131.13333333333333}, {75.733333333333348, 75.733333333333348}}; expected value: {{192.5, 288}, {94.666666666666671, 94.666666666666671}}
2015-08-02 12:39:42.209 nameOfMyProject[1888:51831] This is likely occurring because the flow layout subclass nameOfMyProject.ShopLayout is modifying attributes returned by UICollectionViewFlowLayout without copying them
2015-08-02 12:39:42.209 nameOfMyProject[1888:51831] Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
bu sadece mü Xcode 7 ile başlayalım mı? Xcode 7 (ve iOS9'u yükleyerek) güncellemesinden bu yana bana da çok benzer bir şey geldi. Ben Obj-C, hızlı değil, ama hata, onları değiştirmeden önce öznitelikleri kopyalamamanızı söylüyor. NSArray * allAttributesInArray = [[super layoutAttributesForElementsInRect: rect] copy]; '' bunları manipüle etmeden önce bir şey yapmayı denedim, ancak bu da işe yaramıyor. – wanderingme
xcode 7'den önce hiçbir zaman koleksiyon görünümü kullanmıyorum. Alt sınıfsız eski bir akışLayout kullanarak sonlandırdım, bu yüzden gerçekten bir cevap veremiyorum – brumbrum
@wanderingme bunu nasıl çözeceğinizi öğrendiniz mi? Bende aynı olan var ve hiçbir şey onu çözmeye yardım etmedi. – Solomiya