ios - Cell.selectedBackgroundview not showing -


cell.selectedbackgroundview isn't working. have figured out selectedview placed behind image in cell resulting in no visible image (i worked out making image small saw tick behind image). there way fix this? code seems fine must have layers

static nsstring *identifier = @"cell";  uicollectionviewcell *cell = [collectionview dequeuereusablecellwithreuseidentifier:identifier forindexpath:indexpath]; uiimageview *productimages = (uiimageview *)[cell viewwithtag:100]; productimages.image = [uiimage imagenamed:[allproducts_sections[indexpath.section]objectatindex:indexpath.row]];   collectionview.backgroundcolor = [uicolor greencolor];   cell.selectedbackgroundview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"tick 1.png"]]; collectionview.allowsmultipleselection = yes; return cell  

as can see blue selected backgroundview , blackbox image why doesnt selectedbackgorundview go on black box

-(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath {   static nsstring * cellidentifier = @"cell";   uitableviewcell * cell = [tableview dequeuereusablecellwithidentifier:cellidentifier];   if (cell==nil)    {     cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier];   //some code   }   uiview *selectedbackview=[[uiview alloc]initwithframe:cell.bounds];   uiimageview *selectionimg = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"tick 1.png"]];   [selectedbackview addsubview:selectionimg];   cell.selectedbackgroundview=selectedbackview;   return cell; } 

also make sure tick 1.png in project's bundle.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -