简体   繁体   中英

Autolayout UICollectionviewCell in iOS8

I have a problem with UICollectionViewCell in iOS 8. It didn't resize like what I expected.

My idea is :

I have an UIViewController class with storyboard Add an UICollectionView that has size equal with ViewController View And UICollectionView has cell size equal to its

No matter what I do, the cell didn't resize to its UICollectionView

P/S: I am using size class too

Anyone can show me how to achieve my idea?

Edit: I have resolved my problem. please closed this for me. Thanks

You should be able to. See below. I have the CollectionView selected in the document outline on the left. Notice the size inspector on the right. You have to make sure it's size matches that of the underlying ViewController. In this case 320x568. I did my best to match the ViewController size manually, but when I looked in the size inspector it was slightly small. So I adjusted it. Then you can stretch your collection cell to match in the storyboard.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM