gpt4 book ai didi

iphone - 扩展 UIView -Iphone

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:30:00 24 4
gpt4 key购买 nike

我正在开发一款 iPhone 应用程序,当您按下按钮时,UITableView 会下降。我想插入/动画按钮下方的对象,以便它们位于 tableview 下方。

对于每个需要向下移动的标签/文本字段,我需要这样的东西:

[UIView beginAnimations: @"anim" context: nil];
[UIView setAnimationBeginsFromCurrentState: YES];
[UIView setAnimationDuration:0.3f];
self.view.frame = CGRectOffset(self.view.frame, 0, 70);

任何示例都会有所帮助。

最佳答案

在 iPhone OS 4.0 及更高版本中,block-based animation methods由 Apple 推荐,例如

+ (void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations

例如。

[UIView animateWithDuration:0.3 
delay:0
options:UIViewAnimationOptionBeginFromCurrentState
animations:(void (^)(void)) ^{
self.view.frame = CGRectOffset(self.view.frame, 0, 70); }
completion:^(BOOL finished){

}];

关于iphone - 扩展 UIView -Iphone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18015289/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com