Closed oscar608 closed 8 years ago
Hi, try explaining your case in more words please. It is hard for me to see what is the problem and what can be causing it.
in iphone 6 is ok
the view controller have a tableview,and i add a UIScrollView as the tableview header by the follow code:
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = Util.getBackgroundColor()
self.automaticallyAdjustsScrollViewInsets = false
let frame = CGRectMake(0, 0, self.view.frame.size.width, 150)
scrollView.frame = frame
scrollView.auk.settings.errorImage = UIImage(named: "icon_sj_me.png")
scrollView.auk.show(url: "http://7xljm5.com2.z0.glb.qiniucdn.com/11.png")
scrollView.auk.show(url: "http://7xljm5.com2.z0.glb.qiniucdn.com/22.png")
scrollView.auk.show(url: "http://7xljm5.com2.z0.glb.qiniucdn.com/33.png")
scrollView.auk.settings.contentMode = UIViewContentMode.ScaleAspectFill
// Set background color of page indicator
scrollView.auk.settings.pageControl.backgroundColor = UIColor.grayColor().colorWithAlphaComponent(0.3)
scrollView.auk.startAutoScroll(delaySeconds: 3)
self.tableView.tableHeaderView = scrollView
}
and then in iphone 6 is ok, but in iphone 4 and iphone 5 have a blank on the top:
I have done two things to make it work:
scrollView.auk.settings
before showing images (setting UIViewContentMode.ScaleAspectFill).Hope it helps
func createScrollView() {
let scrollView = UIScrollView()
scrollView.backgroundColor = UIColor.greenColor()
scrollView.auk.settings.contentMode = UIViewContentMode.ScaleAspectFill // Set before showing images
self.view.backgroundColor = UIColor.yellowColor()
self.automaticallyAdjustsScrollViewInsets = false
let frame = CGRectMake(0, 0, self.view.frame.size.width, 150)
scrollView.frame = frame
self.tableView.tableHeaderView = scrollView // Set scroll view before showing images
scrollView.auk.settings.errorImage = UIImage(named: "icon_sj_me.png")
scrollView.auk.show(url: "http://7xljm5.com2.z0.glb.qiniucdn.com/11.png")
scrollView.auk.show(url: "http://7xljm5.com2.z0.glb.qiniucdn.com/22.png")
scrollView.auk.show(url: "http://7xljm5.com2.z0.glb.qiniucdn.com/33.png")
// Set background color of page indicator
scrollView.auk.settings.pageControl.backgroundColor = UIColor.grayColor().colorWithAlphaComponent(0.3)
scrollView.auk.startAutoScroll(delaySeconds: 3)
}
goood!!!!! it is ok now,Thank you very much!!!~~~~