Upgrade to Pro — share decks privately, control downloads, hide ads and more …

20160727 UIStackViewを使ってみた

20160727 UIStackViewを使ってみた

関モバ #16 の資料です

Kei Ito

July 27, 2016
Tweet

More Decks by Kei Ito

Other Decks in Programming

Transcript

  1. BMJHONFOU w pMM w MFBEJOH UPQ  w pSTU#BTFMJOF w

    DFOUFS w USBJMJOH CPUUPN  w MBTU#BTFMJOF
  2. ྫ w σόΠε͕ॎͳΒॎฒͼɺԣͳΒԣฒͼ w ԣͷ࣌͸ཁૉΛݮΒͯ͠ΈΔʢIJEEFOUSVFʣ w ֤7JFX͸౳ִؒͰฒͿʢFRVBM4QBDJOHʣ if self.view.frame.width >

    self.view.frame.height { self.stackView.axis = .horizontal self.stackView.arrangedSubviews[2].isHidden = true } else { self.stackView.axis = .vertical self.stackView.arrangedSubviews[2].isHidden = false }
  3. ྫ w 6*4UBDL7JFXΛωετ͢Δ w ਌ͱࢠͰσόΠεͷॎԣʹର͢Δฒͼํ޲Λม͑Δ w ֤7JFX͸ը໘͍ͬͺ͍ʢpMMʣ if self.view.frame.width >

    self.view.frame.height { self.stackView.axis = .horizontal self.subStackView.axis = .vertical } else { self.stackView.axis = .vertical self.subStackView.axis = .horizontal }