2016-07-05 43 views
1

我設計了UICollectionViewCell故事板.Consists 2個元素UILabel,UIImageView。UILabel in UICollectionViewCell

爲的UILabel I中給出的約束導致= 0,尾隨= 0,底部= 0,高度= 100

collectionViewCell enter image description here

但是,當我在模擬器中運行: enter image description here

編輯:當我在接口檢查器中觀察,標籤未附加到collectionView上查看: enter image description here

+0

你確定這一切約束啓用?此外,請檢查您是否只提供特定尺寸的課程 –

+0

@MehulThakkar:我正在爲iPad工作。所以我給了wR hR –

+0

@MehulThakkar:看我的編輯 –

回答

0

我解決了問題,在cellForItemAtIndexPath加上幾行

[cell setNeedsLayout]; 
[cell layoutIfNeeded]; 
相關問題