UICollectionView Benutzerdefinierte Zelle zum Füllen der Breite in Swift

Ich habe versucht, die Figur-aus, wie kann ich die Zelle füllen Sie die Breite, wie Sie im Bild sehen können, die Breite zwischen den Zellen ist zu groß. ich bin mit benutzerdefinierten Zelle mit nur einer Bildansicht.

UICollectionView Benutzerdefinierte Zelle zum Füllen der Breite in Swift

Habe ich versucht, um es aus dem storyboard, aber ich denke, es gibt keine option, oder sollte es programmgesteuert ausgeführt werden.
UICollectionView Benutzerdefinierte Zelle zum Füllen der Breite in Swift

meine UICollectionViewController :

 @IBOutlet var collectionView2: UICollectionView!

    let recipeImages = ["angry_birds_cake", "creme_brelee", "egg_benedict", "full_breakfast", "green_tea", "ham_and_cheese_panini", "ham_and_egg_sandwich", "hamburger", "instant_noodle_with_egg.jpg", "japanese_noodle_with_pork", "mushroom_risotto", "noodle_with_bbq_pork", "starbucks_coffee", "thai_shrimp_cake", "vegetable_curry", "white_chocolate_donut"]

    override func viewDidLoad() {
        super.viewDidLoad()

        //Uncomment the following line to preserve selection between presentations
        //self.clearsSelectionOnViewWillAppear = false

        //Do any additional setup after loading the view.

    }


    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        //Dispose of any resources that can be recreated.
    }

override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
        //#warning Incomplete method implementation -- Return the number of sections
        return 1
    }


    override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        //#warning Incomplete method implementation -- Return the number of items in the section
         return recipeImages.count
    }

    override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! RecipeCollectionViewCell

        //Configure the cell
        cell.recipeImageView.image = UIImage(named: recipeImages[indexPath.row])

        return cell
    }

InformationsquelleAutor der Frage AaoIi | 2015-05-01

Schreibe einen Kommentar