GithubHelp home page GithubHelp logo

abouttableviewcelltapaction's Introduction

aboutTableViewCellTapAction

昨晚上遇到了一个小问题,在这里做一个简单的记录,免得自己忘了

背景是这样的,我有两个界面(viewController),第一个节目的主要内容是一个TableView,第二个界面只有一个简单的Label,也就是说,我在第二个界面并没有什么耗时的代码。我想达到的效果是,当我点击第一个界面的cell的时候,跳转到第二个界面。但是当我执行点击这个动作的时候,系统并没有立刻执行跳转,而是像被卡顿了一样,又或者是等一段时间后才跳转成功。刚刚开始我以为是什么内存问题,或者是什么引用问题,但是排查之后,都否认了。最后在网上找到了答案。

当cell的selectionStyle属性设置为.none时会出现该情况

然后我把cell的selectionStyle设置成了.default,问题解决

(ps:因为一般的cell点击后会一直取得那个位置的焦点,所以为了美观,我在didSelectRowAt这个协议函数中添加了这句 tableView.deselectRow(at:indexPath,animated:true))

abouttableviewcelltapaction's People

Contributors

changexuan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.