Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在主视图中添加了一个 UIPickerView 作为子视图。我在主视图中还有一系列文本字段,所以选择器视图覆盖了一些。所以我想知道是否可以在选择器视图(添加到主视图的子视图)保持静止时移动主视图(包含文本字段)?
完成此操作的唯一方法是将子视图沿相反方向移动相同的量,从而否定子视图的移动。因此,例如,如果我将父母的 x 原点移动 +42 像素,我应该将孩子的 x 原点移动 -42 像素。这可以很容易地封装到单个调用中。