iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 25
1
Software Development

挑戰 30天內送審一支APP 系列 第 25

UIScrollView (四.5) ( D Day + 24 )

倒數第五天竟然寫不出一個完整個結果!!!
今天試了一整天,想要把 image 配合 UIDevice.current.orientation , 當orientation = "landscaps"或 "portrait",imageivew會呈現不同的圖片。
因此我另外寫一個function

func rotated() {
        
        if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) {
            print("landscape")
            myImageView = UIImageView(image: UIImage(named: "03.jpg"))

        } else if UIDeviceOrientationIsPortrait(UIDevice.current.orientation) {
            print("portrait")
            myImageView = UIImageView(image: UIImage(named: "01.jpg"))

        }
    }

並且在viewDidLoadviewWillTransition 的時候呼叫,結果圖片依然保持在同一個沒有改變。
今天沒有圖可以發!!! 只好先這樣明天再繼續~~~


上一篇
UIScrollView (三) ( D Day + 23 )
下一篇
UIScrollView (五) ( D Day + 25 )
系列文
挑戰 30天內送審一支APP 30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言