시간별 날씨를 표시하려는 컬렉션 뷰가 있습니다. 셀을로드하는 데 문제가있는 것 같습니다. 그리고 어떤 이유로 스크롤하여 전달한 다음 완전히 다시로드합니다. 컬렉션 뷰를 스크롤하기 전에 모든 제약 조건이 작동하지 않고 하나의 레이블에 정보가 표시되지 않습니다.UICollectionView가 스크롤 할 때까지 완전히로드되지 않습니다.
비동기 당신의 세포를 채우는 같은 다음 mycollectionview을 추가하는 경우
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of items
return newhourlyWeather.count
}
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! hourlyWeatherCell
// Configure the cell
let hWeather = newhourlyWeather[indexPath.row]
if let HourlyTemp = hWeather.temperatureh {
cell.temperatureHLabel.text = "\(HourlyTemp)º"
}
if let HourlyTime = hWeather.convertedTimeH {
cell.timeHLabel.text = "\(HourlyTime)"
}
if let HourlyRain = hWeather.precipProbabilityh {
cell.rainChanceHLabel.text = "\(HourlyRain)%"
}
cell.iconhView.image = hWeather.iconh
return cell
self.collectionView.reloadData()
}
어떤 코드가 필요한지 알고 싶습니다. – zombie
제약 조건에 대한 코드 및 추가 정보가 없으면이 질문에 대한 답변을 얻을 수 없습니다. – vikingosegundo
업데이트 된 질문 @vikingosegundo – fellowProgrammer