Ich versuche, einfache pädagogische App über Filme zu erstellen, und ich muss Filmrahmen horizontalen Scroller erstellen.Autoresize UICollectionViewCell Größe in UITableView
Ich schaffe für die Sammlung Ansicht:
Aber wenn ich es für ein anderes Ziel (iPhone 6s plus zum Beispiel) zu bauen, ich habe dies:
Wie dieses Problem zu lösen?
Meine Szene Controller-Code (Swift 3):
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 4
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath)
cell.backgroundColor = UIColor.black
// Configure the cell
return cell
}
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
Was ist das Problem? :) –
Ich möchte eine Zelle nahm den gesamten Raum von collectionView, von einer Seite des Bildschirms auf eine andere. – IlyaGutnikov