iOS equivalent for Android View.GONE visibility mode

前端 未结 13 754
臣服心动
臣服心动 2020-12-12 19:22

I\'m developing an app for iOS and I\'m using the Storyboard with AutoLayout ON. One of my view controllers has a set of 4 buttons, and in certain circumstances i would like

13条回答
  •  既然无缘
    2020-12-12 20:16

    To achieve Androids.GONE functionality on iOS is to use a UIStackView. After that hide the child by position. (Apples documentation)

    SWIFT 4:

    let firstView = cell.rootStackView.arrangedSubviews[0]
        firstView.isHidden = true // first view gone
    

    It's a table cell example, just put both insides Stack view and get item for GONE the child.

提交回复
热议问题