Coder Social home page Coder Social logo

gq630960023 / tableviewcellheight-autolayout-manuallayout Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 107 KB

在TableViewCell中, 经常使用 UILabel 与 UITextView 来存放cell中的文字, 而计算高度却经常产生问题. 本Demo通过AutoLayout 与 ManualLayout 的两种方式来计算高度.

Objective-C 100.00%
tableviewcell cell-height

tableviewcellheight-autolayout-manuallayout's Introduction

###说明

在TableViewCell中, 经常使用 UILabel 与 UITextView 来存放cell中的文字, 而计算高度却经常产生问题. 本项目通过不同方式解决此问题.

###功能

  • 通过AutoLayout 与 ManualLayout 的两种方式来获取高度.
  • 对TextView输入内容即时更新Cell高度.
  • iOS8 EstimatedHeightForRow
ManualLayout即UILabel或UITextView通过sizeThatFit的方式计算高度.

###参考

###使用记录

使用iOS8的EstimatedHeightForRow方式时遇到使用TextView无法计算高度的问题.更换为UILabel之后展示正确. 估计TextView因内部容器的size与自身size不一致导致. 同理, 如果cell中存在ScrollView及其子类, 应该有同样的问题.

tableviewcellheight-autolayout-manuallayout's People

Contributors

gq630960023 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

fhchina 2667

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.