ios - why does the dynamic collection cells in collection view doesnt display as given size and changes after scrolling in swift 3 -


i have collection view.i need display cells varying width @ sequences. first 4 cells displayed required after consecutive 5th image disappears , others displayed not in desired manner. doesnot show in simulator. view gets distorted when scrolling collection view.please me out in swift 3.

if want resize uicollectionviewcell try implement method, setting frame inside cellforrowat wrong.

func collectionview(_ collectionview: uicollectionview!, layout _: uicollectionviewlayout!, sizeforitematindexpath indexpath: indexpath!) -> cgsize {     if indexpath.row%3 == 0 {         return cgsize(width: 172, height: 120)     } else {         .....     }//switch, if, whatever } 

Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -