ios - tableView imageView content mode not working? -


i have image, inside of table row, i'm trying make round doing height/2

cell.imageview.frame.height/2 

so problem when i'm trying insert image cell, image doesn't change size, code looks this

let named = "avatar.png" let imagename = uiimage(named: named) cell.imageview?.image = imagename cell.backgroundcolor = uicolor.clearcolor() if(tablearray[indexpath.row] == "avatar"){     cell.imageview!.frame = cgrectmake(0,0,10,10)     cell.imageview?.layer.borderwidth = 1     cell.imageview?.layer.maskstobounds = true     cell.imageview?.layer.bordercolor = uicolor.blackcolor().cgcolor     cell.imageview?.layer.cornerradius = cell.imageview!.frame.height/2     cell.imageview?.clipstobounds = true     cell.imageview?.contentmode = .scaleaspectfit } 

i've tried lot of suggestions google, stackoverflow couldn't whats problem, can help?

you cannot change size of imageview present in default uitableviewcell , if want change imageview size need take custom uitableviewcell .


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -