简体   繁体   English

iOS在静态UITableViewCell中为UIPickerView设置动画

[英]iOS animate UIPickerView inside static UITableViewCell

I have a static UITableViewCell with UIPickerViews inside the cells. 我有一个静态UITableViewCell ,单元格内有UIPickerViews I am trying to animate the cell to be shown when the cell above it is clicked. 我正在尝试对要单击的上方单元格显示的单元格进行动画处理。 I used [self.tableview beginUpdates] and [self.tableView endUpdates] to animate the cell itself which slides down nicely into place. 我使用[self.tableview beginUpdates][self.tableView endUpdates]来设置单元格本身的动画效果,该单元格很好地滑落到位。 The UIPickerView however, appears on the screen before the animation for the cell finishes loading and looks very ugly. 但是,该单元的动画加载完成之前, UIPickerView出现在屏幕上,并且看起来非常丑陋。 How can I animate it so that it slides along with the UITableViewCell ? 如何为它设置动画,使其与UITableViewCell一起滑动?

I also don't understand why it is not cut off by the expanding cell, since it is inside the cell shouldn't it grow along with the cell and not just appear at once? 我也不明白为什么它不能被扩展的细胞截断,因为它在细胞内部,它不应该随细胞一起生长而不是一次出现吗?

Thanks in advance for the help! 先谢谢您的帮助!

Nevermind I figured it out. 没关系,我想通了。 Had to have cell.autoresizingMask= UIViewAutoresizingFlexibleHeight; 必须具有cell.autoresizingMask = UIViewAutoresizingFlexibleHeight; and cell.clipsToBounds = YES; 和cell.clipsToBounds = YES; enabled for the cell. 为单元启用。 Can't believe it took three hours to solve this. 无法相信花了三个小时来解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM