gpt4 book ai didi

ios - UIView iOS 上的可拖动行为的名称是什么?

转载 作者:行者123 更新时间:2023-11-28 18:44:36 24 4
gpt4 key购买 nike

iOS 中的大多数 View 都是可拖动的,就像在 Safari 中一样,我可以拖动它,当我释放它时它会弹回原位。此行为称为什么引用。

最佳答案

您想实现 UIScrollView .

The central notion of a UIScrollView object (or, simply, a scroll view) is that it is a view whose origin is adjustable over the content view. It clips the content to its frame, which generally (but not necessarily) coincides with that of the application’s main window. A scroll view tracks the movements of fingers and adjusts the origin accordingly. The view that is showing its content “through” the scroll view draws that portion of itself based on the new origin, which is pinned to an offset in the content view. The scroll view itself does no drawing except for displaying vertical and horizontal scroll indicators. The scroll view must know the size of the content view so it knows when to stop scrolling; by default, it “bounces” back when scrolling exceeds the bounds of the content.

关于ios - UIView iOS 上的可拖动行为的名称是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6376122/

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