ios - AppTest on iPhone 6 reveals unknown screen glitches (gray lines) -
i own iphone 5 , have tested app on it, works on iphone 5 device, iphone 5 , 6 simulator, when borrowed iphone 6 weird gray lines started appearing , disappearing (when move iphone around move , disappear) around collection view cells, buttons (which in uiview
containers)
i erased , still there, i've hidden buttons in cells, putted backrground , border color clear ; these lines sort of follow borders of cell.
func numberofsectionsincollectionview(collectionview: uicollectionview) -> int { return 1 } func collectionview(collectionview: uicollectionview, numberofitemsinsection section: int) -> int { switch collectionview{ case collectionviewone!: return collectionviewonerows case collectionviewtwo!: return collectionviewtworows default: return 0 } } func collectionview(collectionview: uicollectionview, cellforitematindexpath indexpath: nsindexpath) -> uicollectionviewcell { switch collectionview{ case collectionviewone!: let cell = collectionview.dequeuereusablecellwithreuseidentifier("collectionviewcell", forindexpath: indexpath) as! collectionviewcell cell.backgroundcolor = uicolor.whitecolor() cell.textlabel.text = "hempel product" println(int(indexpath.row)) cell.buttonview.tag = int(indexpath.row) cell.buttonview.setbackgroundimage(uiimage(named: "hempel"), forstate: uicontrolstate.normal) cell.buttonview.addtarget(self, action: selector("action:"), forcontrolevents: uicontrolevents.touchupinside) cell.layer.cornerradius = 3 return cell case collectionviewtwo!: let cell = collectionview.dequeuereusablecellwithreuseidentifier("collectionviewcell1", forindexpath: indexpath) as! collectionviewcell cell.backgroundcolor = uicolor.whitecolor() cell.textlabel.text = "hempel product1" println(int(indexpath.row)) cell.buttonview.tag = int(indexpath.row) cell.buttonview.setbackgroundimage(uiimage(named: "hempel"), forstate: uicontrolstate.normal) cell.buttonview.addtarget(self, action: selector("action1:"), forcontrolevents: uicontrolevents.touchupinside) cell.layer.cornerradius = 3 return cell default: let cell = collectionview.dequeuereusablecellwithreuseidentifier("collectionviewcell", forindexpath: indexpath) as! collectionviewcell return cell } }
did have experience this?
class collectionviewcell: uicollectionviewcell { required init(coder adecoder: nscoder) { super.init(coder: adecoder) } var textlabel: uilabel = uilabel() var buttonview: uibutton! override init(frame: cgrect) { super.init(frame: frame) // problem sa iphone 6 crtice contentview.backgroundcolor = uicolor.clearcolor() contentview.layer.bordercolor = uicolor.clearcolor().cgcolor // buttonview = uibutton.buttonwithtype(uibuttontype.system) as! uibutton buttonview.frame = cgrect(x: frame.width / 2 - frame.width * 0.3, y: 0, width: frame.size.width * 0.6, height: frame.size.height * 0.8) contentview.addsubview(buttonview) let textframe = cgrect(x: 0, y: 90, width: frame.size.width, height: frame.size.height/3) textlabel = uilabel(frame: textframe) textlabel.font = uifont.systemfontofsize(uifont.smallsystemfontsize()) textlabel.textalignment = .center contentview.addsubview(textlabel) } }
Comments
Post a Comment