- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建一个 UITableView
选择时,单元格会“滑出”下方的附加 View 。为此,我使用 [tableview beginUpdates]
为表格 View 中的行高设置了动画。和 [tableView endUpdates]
然后我正在为滑动 View 设置动画,使其与该动画一起翻译,使其看起来像是被揭开的。我使用的动画效果很好,但与行高的移动方式略有不同。
例如,这是我的单元格。通常,只显示白色部分(由于突出显示为蓝色),但如果您选择一行,灰色 View 会从底部滑出,就像该行的操作菜单一样,带有几个按钮:
我想知道的是:table view的BeginUpdates
默认使用的动画设置是什么?/EndUpdates
方法,或者如果那是未知的,我是否可以将它们设置为自定义,以便我的行高和滑动 View 的动画完全相同?
tableView
方法:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if ([[tableView indexPathForSelectedRow] isEqual:indexPath])
return CellHeightAlternate;
return CellHeightNormal;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
SlideOutViewTableViewCell *newCell = (SlideOutViewTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
[tableView beginUpdates];
[tableView endUpdates];
[newCell showView];
}
SlideOutTableViewCell
showView 方法:
- (void)showView{
[self.slideoutView setFrame:CGRectMake(self.slideoutView.frame.origin.x, 40, self.slideoutView.frame.size.width, self.slideoutView.frame.size.height)];
[UIView animateWithDuration:.25 animations:^{
[self.slideoutView setFrame:CGRectMake(self.slideoutView.frame.origin.x, 70, self.slideoutView.frame.size.width, self.slideoutView.frame.size.height)];
}];
}
最佳答案
所以我通过反复试验找到了答案:
表格 View 更改行高的动画(来自 [tableview beginUpdates]
和 [tableView endUpdates]
方法)是持续时间为 0.3 秒的线性动画(无动画效果)。
关于ios - UITableView - BeginUpdates/EndUpdates 动画设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23748034/
我有一个带有静态单元格的表格 View 。单击单元格可切换与此单元格关联的选择器 View 单元格的可见性(更改单元格高度)。单击单元格的 tag 属性维护选择器单元格的状态。动画由一系列 begin
我有一个应用程序使用 Core Data 来驱动带有部分的 UITableView。它使用所有示例项目使用的标准 NSFetchedResultsControllerDelegate 实现。然而,偶尔
我想在动画结束后添加 slider 按钮,但这不起作用,它会在删除该部分的动画时添加按钮。 [coursesTable beginUpdates]; [coursesTable del
在处理字段更新时,我需要卡住(停止重绘)DataGridView。 有没有像BeginUpdate这样的东西来临时卡住DataGridView 最佳答案 最好的选择是使用 Adam Robinson
我正在构建一个 UITableView选择时,单元格会“滑出”下方的附加 View 。为此,我使用 [tableview beginUpdates] 为表格 View 中的行高设置了动画。和 [tab
我有这个函数,它由单元中的委托(delegate)调用。 它正在调用这个数组: var ingredientsArray = [String]() 我在 viewDidAppear() 中有这个,不确
我的UITableView需要显示来自服务器的一些图像。 UITableViewCell 由单个 UIImageView 和用于 UIImageView 高度的 NSLayoutConstraint
我在每个单元格中使用一个 UITableView 和一个 UITextView 来增加/减少它的高度以适应键入时的文本。为此,我更新了 -textViewDidChange: 委托(delegate)
我正在使用 UITableView 来显示其中包含 UIWebView 的单元格。当 Web View 完成加载时,我通过调用调整单元格的高度 [self.tableView beginUpdates
我在自定义 UITableViewCell 中有一个 UITextView。在扩展 UITextView 时,我希望 UITextView 下方的 subviews 根据其高度下降并增加行高。为此,我
编辑:这个答案的解决方案与 iOS7 有时返回 NSIndexPath 而其他时候返回 NSMutableIndexPath 有关。该问题与 begin/endUpdates 并没有真正相关,但希望该
我正在使用 beginUpdates/endUpdates block 对 tableView 进行更改。在整个过程中,我需要更新投影,以便它反射(reflect) tableView 的当前构图。
我有一个 richTextBox,我用它来执行一些语法突出显示。这是一个小型编辑工具,所以我没有编写自定义语法荧光笔 - 相反,我使用 Regex 并使用 Application.Idle 的事件处理
我编写了一个UserControl,其行为类似于ContainerControl,但完全由WindowsForms 绘制(我继承自UserControl) 我想避免在填充控件时绘制控件,因此我需要编写
我目前正在研究 inline UIDate picker 的实现在 UITableViewCell 内部。 当我选择应插入该单元格的正上方的单元格时,我能够显示和隐藏该选择器单元格,这是我期望的行为。
我一直在努力解决扩展 UITextView 这个非常普遍的问题。在不断增长的内部 UITableViewCell的 UITableView除了一件小事,我几乎就到了。 我有一个 UITableView
我需要执行 [[self tableView] reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableView
我的 TableView 显示用户列表。添加用户后刷新 TableView 时遇到问题。我尝试了不同的代码和事件组合,现在应用程序在 endUpdates 调用时崩溃。该应用程序是根据食谱应用程序建模
我在使用 Core Data 时遇到了一些性能问题,我希望有人能给我一些关于如何改进它的提示。调用save:时对于我的NSManagedObjectContext ,单个实体的保存时间超过 1 秒。我
我有一个应用程序,当用户首次启动应用程序时,它会显示一个自定义的无数据单元格。 当用户输入第一个条目时,我的 fetchedResultsController 的 fetchedResults 会被更
我是一名优秀的程序员,十分优秀!