CustomCollectionViewLayout
ile kodları çalışıyorum ve içinde a lot of small cells
var ama kullanıcı zoom
olmadan göremiyorum. Ayrıca tüm hücreler seçilebilir.Yakınlaştırmak UICollectionView
ben yakınlaştırma özelliği içinde benim toplama görünümü eklemek istediğiniz!
aşağıda altında My net kodları.
class CustomCollectionViewController: UICollectionViewController {
var items = [Item]()
override func viewDidLoad() {
super.viewDidLoad()
customCollectionViewLayout.delegate = self
getDataFromServer()
}
func getDataFromServer() {
HttpManager.getRequest(url, parameter: .None) { [weak self] (responseData, errorMessage) ->() in
guard let strongSelf = self else { return }
guard let responseData = responseData else {
print("Get request error \(errorMessage)")
return
}
guard let customCollectionViewLayout = strongSelf.collectionView?.collectionViewLayout as? CustomCollectionViewLayout else { return }
strongSelf.items = responseData
customCollectionViewLayout.dataSourceDidUpdate = true
NSOperationQueue.mainQueue().addOperationWithBlock({() -> Void in
strongSelf.collectionView!.reloadData()
})
}
}
}
extension CustomCollectionViewController {
override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
return items.count
}
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items[section].services.count + 1
}
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! CustomCollectionViewCell
cell.label.text = items[indexPath.section].base
return cell
}
override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath cellForItemAtIndexPath: NSIndexPath) {
print(items[cellForItemAtIndexPath.section].base)
}
}
Ayrıca Görebildiğimizi aşağıda altında benim UICollectionView
düzen özellikleri i maxZoom 4
seçilen ancak doesnt
herhangi bir işlem var!
teşekkür ederiz! Basit bir kaydırma görünümünü Büyütmek ediyorum gibi
Bu soru faydalı olabilir: [Make collectionview yakınlaştırılabilir] (http://stackoverflow.com/questions/13485617/make-uicollectionview-zoomable) – jojoT
@jojoT ty ama bu örnek obj-c ve tutam yakınlaştırma her öğe hızlı ve alan zoom istiyorum her öğe basit zoom – SwiftDeveloper
kullanıcı toplama görünümü dokunur, sonra hücre zoom olsun? Demek istediğin, Dokunmadan sonra, tüm koleksiyon görünümü bulanıklaşır ve hücreye dokundu, yalnızca ekranın merkezi görülebilir genişlikte ve yükseklikte görüntülendi mi? –