imageButton.setImage(viewModel.image, for: .normal)

(Button setImage 時,無法顯示圖片或變藍色...)

 

(變TextColor 藍色  ,setImage沒有顯示圖片)

 

(這時只要把 Button type 由System 改為 Custom就能解決這個問題)

 

(Button type 設成 Custom 後,可正常顯示圖片)

 

參考資料:

http://stackoverflow.com/questions/20563271/buttons-turn-blue-when-backgroundimage-is-set

arrow
arrow
    全站熱搜

    小賢 發表在 痞客邦 留言(0) 人氣()