feed select highlight effect

This commit is contained in:
nixzhu
2015-09-28 16:19:19 +08:00
committed by nixzhu
parent 1359325d11
commit a9eefecae3
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -1575,7 +1575,7 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Tuy-Vc-gDL">
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" delaysContentTouches="NO" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="Tuy-Vc-gDL">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="FkS-Hc-62O">
<size key="itemSize" width="50" height="50"/>
@@ -108,5 +108,17 @@ extension FeedsViewController: UICollectionViewDataSource, UICollectionViewDeleg
performSegueWithIdentifier("showConversation", sender: nil)
}
func collectionView(collectionView: UICollectionView, didHighlightItemAtIndexPath indexPath: NSIndexPath) {
let cell = collectionView.cellForItemAtIndexPath(indexPath) as! FeedCell
cell.contentView.backgroundColor = UIColor.lightGrayColor()
}
func collectionView(collectionView: UICollectionView, didUnhighlightItemAtIndexPath indexPath: NSIndexPath) {
let cell = collectionView.cellForItemAtIndexPath(indexPath) as! FeedCell
cell.contentView.backgroundColor = UIColor.clearColor()
}
}