AppTest на iPhone 6 показывает неизвестные глюки экрана (серые линии)
У меня есть iPhone 5, и я всегда тестировал приложение на нем, все работает на устройстве iPhone 5, симуляторе iPhone 5 и 6, но когда я позаимствовал iPhone 6, странные серые линии стали появляться и исчезать (когда я перемещаю iPhone, они двигаются и исчезают) вокруг ячеек представления коллекции, кнопок (которые все в UIView
контейнеры)
Я удалил все, и они все еще там, я спрятал кнопки, которые находятся в ячейках, поместил весь фон и цвет рамки для очистки; эти линии как бы следуют границам клетки.
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
}
}
У кого-нибудь был опыт с этим?
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)
}
}