【问题标题】:How can i highlight selected cell's in PSTCollectionview?如何在 PST Collectionview 中突出显示选定的单元格?
【发布时间】:2013-07-03 05:51:51
【问题描述】:

我使用 PSTCollection 视图进行网格布局,因此它将支持 iOS 5.0 及更高版本,但是当我单击一个单元格时,它工作正常。我试图在选定单元格上实现一个选择效果,如发光边框,这样它会增加用户体验。任何有人知道如何在 PSTCollectionview 中进行操作吗?

【问题讨论】:

    标签: ios objective-c cell collectionview pstcollectionview


    【解决方案1】:
    - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
    {
        CustomCell *customCell = (CustomCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"CustomCell" forIndexPath:indexPath];
    
        //TODO: Customize your cell here
    }
    

    【讨论】:

    • 当用户选择一个单元格时。上面的方法被调用。您需要访问单击的单元格并将您喜欢的效果添加到单元格中。希望你明白了。
    • 你的意思是customCell.background-color之类的东西?
    • 是的,您可以更改背景颜色或添加覆盖视图来描述单元格已被选中。
    猜你喜欢
    • 2013-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多