ios - Collection View 单元格边框颜色在 Swift 3 中取消选择
<p><div>
<aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
<div class="d-flex fd-column fw-nowrap">
<div class="d-flex fw-nowrap">
<div class="flex--item wmn0 fl1 lh-lg">
<div class="flex--item fl1 lh-lg">
<b>已结束。</b>此问题是 <a href="https://stackoverflow.com/help/closed-questions" rel="noreferrer noopener nofollow">not reproducible or was caused by typos</a> .它目前不接受答案。
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code>func collectionView(_collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: IndexPath) {
let cell = collectionView.cellForItemAtIndexPath(indexPath) as! DateCell
cell.layer.borderWidth = 2.0
cell.layer.borderColor = UIColor.gray.cgColor
}
func collectionView(_collectionView: UICollectionView, didDeselectItemAtIndexPath indexPath: IndexPath) {
let cell = collectionView.cellForItemAtIndexPath(indexPath) as! DateCell
cell.layer.borderWidth = 2.0
cell.layer.borderColor = UIColor.gray.cgColor
}
Try This One
</code></pre></p>
<p style="font-size: 20px;">关于ios -Collection View 单元格边框颜色在 Swift 3 中取消选择,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/45880165/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/45880165/
</a>
</p>
页:
[1]