如果我有一个很长的文本作为提示文本,例如:
[[self navigationItem] setPrompt:[NSString stringWithFormat:@"This is a very long message which I want it to be scrolled. So that the user can read all the text."]];
如何使它自动滚动?
我的解决办法是:
将promptText设置为nil。用长文本创建UILabel。动画uilabel.position.x并使用循环.
我遵循了关于如何使用iOS创建交互式UIViewPropertyAnimator控制中心动画的教程:
当在底部菜单上或下滑动时,在释放手指后,我想在UIViewPropertyAnimator中添加pan速度并继续动画:
popupViewPanned(recognizer:) {
switch recognizer.state {
.
.
.
// after finger released
case .end:
// continue all animations using pan vel