ios - Unable to set background image for UICollectionView -


i have been trying add custom background image app. used methods introduced here: how fill background image of uiview

these codes succeeded in both normal uiviewcontroller , uitableviewcontroller, failed in uicollectionviewcontroller. black.

as far understand, uitableviewcontroller has similar structure uicollectionviewcontroller. compared setting these 2 controllers , same (in view section). how come code works on 1 not on other one?

the best way implement implement through code inside viewdidload collectionview

    let bgimage = uiimageview();     bgimage.image = uiimage(named: "bg4");     bgimage.contentmode = .scaletofill       self.collectionview?.backgroundview = bgimage 

Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

c++ - Qt setGeometry: Unable to set geometry -

batch file - How to extract all multi-volume RAR archives from subfolders of a folder? -