简体   繁体   English

使用UIGravityBehavior的子视图具有不同的重力

[英]Have subviews using UIGravityBehavior have different gravity

I've got a viewController with a set of subviews. 我有一个带有一组子视图的viewController。 Currently, the gravity is the same for all of them. 目前,所有这些引力都相同。 I want to be able to set different gravity direction values for each subview. 我希望能够为每个子视图设置不同的重力方向值。 Could someone show me how to do this? 有人可以告诉我该怎么做吗?

Thanks in advance 提前致谢

EDIT: Currently getting this output in the console "Multiple gravity behavior per animator is undefined and may assert in the future" 编辑:当前在控制台中获得此输出“每个动画师的多重重力行为是未定义的,将来可能会断言”

创建了一个UIDynamicAnimator和UIGravityBehavior对象数组,现在可以正常工作

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

相关问题 iOS向子视图添加UIGravityBehavior并不总是有效 - iOS adding UIGravityBehavior to subviews does not always work 使用自动布局创建具有多个不同自定义单元格且具有几乎相同子视图的UITableView - Use Auto Layout to create UITableView with multiple different custom cells have almost the same subviews 如何使两个子视图相互交互? - How to have two subviews interact with each other? iPad子视图似乎具有纵向方向 - iPad Subviews appear to have portrait orientation iOS:针对UIView的“添加了所有子视图时”的回调 - iOS: Callback of 'When all subviews have been added' for a UIView 为什么我必须删除UITableViewCell的已添加子视图,而不要删除UITableViewCell的子类中的子视图? - Why do I have to remove added subviews for UITableViewCell but not in a Subclass of UITableViewCell? UIView事件具有约束,并设置子视图的宽度 - UIView event to have constraint apply and set subviews width Swift-单独的视图具有共享相同内存的子视图? - Swift - separate views have subviews that are sharing the same memory? Xcode 9 UIpageViewController导致子视图UIbutton延迟按下 - Xcode 9 UIpageViewController causing subviews UIbuttons to have a delayed press 在所有子视图具有自动布局之前调用viewWillTransitionToSize - viewWillTransitionToSize called before all subviews have auto-laid-out
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM