Giter Site home page Giter Site logo

netyouli / whc_autolayoutkit Goto Github PK

View Code? Open in Web Editor NEW
866.0 45.0 152.0 14.24 MB

iOS and Mac OS X platforms currently in use the fastest the simplest development to build the UI layout automatically open source library, strong dynamic layout constraint handling capacity,iOS/Mac OS X平台上使用简单动态布局约束处理能力

Home Page: http://www.wuhaichao.com

License: MIT License

Objective-C 97.18% Ruby 0.46% Swift 2.36%
whc autolayout uistackview autocellheight masnory

whc_autolayoutkit's People

Contributors

netyouli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whc_autolayoutkit's Issues

在ipad上布局不对

image
代码如下
UIView *view = [[UIView alloc] init]; view.backgroundColor = [UIColor redColor]; [self.view addSubview:view]; view.whc_LeftSpace(0).whc_RightSpace(0).whc_TopSpace(0).whc_Height(64);

关于+ (CGFloat)whc_CellHeightForIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView identifier:(NSString *)identifier layoutBlock:(void (^)(UITableViewCell * cell))block;

我看cell行高自适应有这个API

/**
 自动计算cell高度: 重用cell api

 @param indexPath cell index
 @param tableView 列表
 @param identifier 重用标示
 @param block cell 布局回调
 @return cell高度
 
 @note 改api定要实现block回调才能正确计算cell高度
 */
+ (CGFloat)whc_CellHeightForIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView identifier:(NSString *)identifier layoutBlock:(void (^)(UITableViewCell * cell))block;

这个和那个传indexpath的有什么区别呢?我看在reload的时候你都是清除了行高缓存

是否兼容 masonry?

用 masonry 布的局,只在计算行高的时候用到这个框架的 api,是否能正确计算出行高?

另外有个疑问一直解决不了,用SDLayout 、本框架和自己做的计算行高都出现同样的问题。
在计算行高的方法中,基本上是用 [tableView dequeueReusableCellWithIdentifier:CellID]的方法起获取一个模型 cell,然后给 model 再计算。问题是 获取到的这个 cell 是空,一直都是空,非常奇怪。SDLayout框架中是空就重新创建了 cell,然后导致页面上有叠在一起的 cell。你的似乎可能也是同样的,因为现象一样。这个问题查了好久,好像没人遇到过,没见到有人提这个的。

还有个问题请教下,只由系统来自动计算行高,在 iOS 11上能正常显示,在 ios 10中就变默认的44了,输出的信息来看,iOS 11中不会有 cellContentView.height = 44 这个约束,在 ios 10中就有,代码没动,也没有定高度,都是由子控件去撑开的。

tabelViewCell的算高方式?

RT,是不是获取 cell 最底部的 view,然后用他的maxY (+加上底部间隙)作为 cell 的高度?
但是我在 heightForRowAtIndexPath里,dequeueReusableCellWithIdentifier 获取 cell,给值, layoutIfNeeded ,然后打印 bottomView 的 frame,全是 0。
高度缓存似乎不是一直12345....延续下去保存的,某些时候会删掉一些?
能讲下 cell 的高度是如何计算的,和高度缓存的机制吗?

使用cell高度的会崩溃

使用:

  • (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return [UITableViewCell whc_CellHeightForIndexPath:indexPath tableView:tableView];
    }

会在下面这里崩溃:

  • (CGFloat)whc_CellHeightForIndexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView {}
    方法的:
    if (tableViewWidth == 0) {
    [tableView layoutIfNeeded]; //崩溃在这里
    tableViewWidth = CGRectGetWidth(tableView.frame);
    }

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.