셀 내부에 imageView가 있습니다. 그러나 해당 셀을 탭하면 탭되었음을 나타내는 시각적 표시가 없습니다. 버튼을 누르면 색상이 변경되는 버튼 내부의 imageView와 동일하게 보이기를 원합니다.
func collectionView(collectionView: UICollectionView, shouldHighlightItemAtIndexPath indexPath: NSIndexPath) -> Bool {
let cell: UICollectionViewCell = collectionView.cellForItemAtIndexPath(indexPath)
// what do i do with the cell.imageView to change it's state to look like it was tapped?
}
func collectionView(collectionView: UICollectionView, shouldHighlightItemAtIndexPath indexPath: NSIndexPath) -> Bool {
let cell: IconCell = collectionView.cellForItemAtIndexPath(indexPath) as! IconCell
cell.imageView.alpha = 0.5
return true
}
func collectionView(collectionView: UICollectionView, didUnhighlightItemAtIndexPath indexPath: NSIndexPath) {
let cell: IconCell = collectionView.cellForItemAtIndexPath(indexPath) as! IconCell
cell.imageView.alpha = 1.0
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다