-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有关全局的 tableViewEstimatedHeightEnabled 属性问题 #252
Comments
这不是设计初衷,是我们的问题,稍后看看。 |
viewController 的 superClass 是
|
你只需要把那几行代码放到 |
这个问题的原因在于你在init完tableView 就立马去修改它的estimated ,这个时机太早了,如果抛开 QMUI,系统原生的代码,这样写也是不生效的,它要求一个比较晚的时机去修改estimated,这也是为什么QMUI里选择了 |
嗯,我明白了,谢谢你的回复! |
不客气 |
大佬还是有问题, 比如,我现在切换到别的页面,在切换回来,会调用 强烈建议把这个全局的设置去掉,以及 qmui_didMoveToSuperview 这个方法去掉。。 |
多说无益,还是直接看图吧: 定位获取到地址之后,我只是简单做了刷新操作,PickerView就出现了错误问题。
现在我只能靠这样才能修复这个问题:
|
有道理,我再看看 |
请更新到 2.2.0,已改为在 UITableView initWithFrame:style: 里去应用开关的值,就不会有之前的问题了。 |
请填写运行环境
iPhone
/iPad
/模拟器
iOS 11.x
9.x
2.x.x
请描述具体问题
全局配置里面有个叫 tableViewEstimatedHeightEnabled 属性,然后
UITableView (QMUI)
这个分类里面有如下代码:我在
ViewController
的viewDidLoad
方法里面如果有如下设置 :因为
viewDidLoad
方法会先调用,qmui_didMoveToSuperview
会后调用,而且tableViewEstimatedHeightEnabled
这个属性默认值为YES
,这样会导致 我viewDidLoad
方法里面的设置都不生效了,变成了qmui_didMoveToSuperview
方法里面else
里面的逻辑。你可以说我全局 把
TableViewEstimatedHeightEnabled
设为NO
不就行了吗。但是我这边还是有很多地方有设置 诸如:self.tableView.estimatedRowHeight = 80;
,如果进行了全局设置,不知道会不会对这些逻辑产生影响。The text was updated successfully, but these errors were encountered: