-
Notifications
You must be signed in to change notification settings - Fork 170
Horizantal pickerview at Center #87
Description
I have Three images ,i want by make default second image at middle ,but i can't do it .Help me
func pickerView(_ pickerView: AKPickerView, didSelectItem item: Int) {
currentScrollIndex = item
preBtn.isHidden = (item == 0) ? true : false
nextBtn.isHidden = (item == pickerViewItems.count - 1) ? true : false
if item == 0{
let caloriesVC = self.storyboard?.instantiateViewController(withIdentifier: "CaloriesViewController")as! CaloriesViewController
caloriesVC.modalTransitionStyle = .crossDissolve
present(caloriesVC, animated: true, completion: nil)
}
else if item == 1{
let goalsVC = self.storyboard?.instantiateViewController(withIdentifier: "GoalsViewController")as! GoalsViewController
goalsVC.modalTransitionStyle = .crossDissolve
present(goalsVC, animated: true, completion: nil)
}
else if item == 2{
let oxigenVC = self.storyboard?.instantiateViewController(withIdentifier: "O2ViewController")as! O2ViewController
oxigenVC.modalTransitionStyle = .crossDissolve
present(oxigenVC, animated: true, completion: nil)
}
}
func pickerView(_ pickerView: AKPickerView, imageForItem item: Int) -> UIImage {
return UIImage(named: "flag_(item)")!.imageWithSize(CGSize(width: 49, height: 49))
}