uiscrollview - Remove top space on zoom image -


i have code load , zoom image:

import foundation import uikit  class imagepreview: uiviewcontroller, uiscrollviewdelegate {      var imageurl = ""      var scrollviewimage = uiscrollview()      var imagepreview = uiimageview()    override func viewdidload()   {       super.viewdidload()        scrollviewimage.delegate = self       scrollviewimage.maximumzoomscale = 5.0       scrollviewimage.minimumzoomscale = 1.0        scrollviewimage.frame = cgrect(x: 0, y: self.view.center.y / 2, width: self.view.frame.size.width, height: 300)       imagepreview.frame = cgrect(x: 0, y: self.view.center.y / 2, width: self.view.frame.size.width, height: 300)        self.view.addsubview(scrollviewimage)       scrollviewimage.addsubview(imagepreview)        imagepreview.image = uiimage(contentsoffile: imageurl)   }    func viewforzooming(in scrollview: uiscrollview) -> uiview?   {       return imagepreview   }  } 

after zoom have space before image (top on it). how can remove it?

p.s. sorry english


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -