-12練習slider-向左走向右走

Rebecca
Rebecca
Sep 3, 2018 · 1 min read

人生有多少擦身而過(!?)

import UIKitclass ViewController: UIViewController {@IBOutlet weak var leftView: UIImageView!@IBOutlet weak var rightView: UIImageView!@IBAction func moveLeaveSlider(_ sender: UISlider) {leftView.alpha = CGFloat(sender.value)rightView.alpha = leftView.alphaleftView.frame.origin.x = CGFloat(-10+270*sender.value)rightView.frame.origin.x = CGFloat(580-261*sender.value)}}

彼得潘的 Swift iOS App 開發教室

學習 Swift iOS App 開發的學生作品集

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade