【问题标题】:How can I move a View "X" points up?如何向上移动视图“X”点?
【发布时间】:2020-11-30 21:30:27
【问题描述】:

当点击 textField 时,我想将 UIView 向上移动。我已经创建了我的 textField 的操作。是否可以在情节提要中使用偏移量?

@IBAction func didBeginMove(_ sender: CurrencyField) {
    
}

【问题讨论】:

标签: swift xcode uiview storyboard move


【解决方案1】:

你可以通过多种方式做到这一点

喜欢

yourView.transform = CGAffineTransform(translationX: 10, y: 10)

或添加顶部/底部约束或此视图并更改它

yourViewSpaceToTop.constant += 20

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-27
    • 2018-08-20
    • 2014-04-20
    • 1970-01-01
    • 2015-10-26
    • 2014-05-13
    • 2017-05-13
    • 2015-11-29
    相关资源
    最近更新 更多