Closed hfzwhd closed 7 years ago
hi i tried to put sticker in a custom uiview and uiimageview but the sticker stuck.cant move or scale. any idea to make this happened?
@IBOutlet weak var stickerCanvasView: UIView! @IBOutlet weak var bgImage: UIImageView! var animator: UIDynamicAnimator! var selectedSticker: StickerView! override func viewDidLoad() { super.viewDidLoad() bgImage.backgroundColor = UIColor.flatMint animator = UIDynamicAnimator(referenceView: view) //let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.tapBackground)) //tapRecognizer.numberOfTapsRequired = 1 //self.view.addGestureRecognizer(tapRecognizer) let sticker = StickerView(contentFrame: CGRect(x: CGFloat(0), y: CGFloat(0), width: CGFloat(150), height: CGFloat(150)), contentImage: UIImage(named: "sticker1")) sticker?.center = bgImage.center sticker?.enabledControl = true sticker?.enabledBorder = true sticker?.delegate = self sticker?.tag = 1 bgImage.addSubview(sticker!) // Do any additional setup after loading the view. }
Did u set your customView.userInteractionEnabled to YES ?
oh my. now that settles it. thanks!
hi i tried to put sticker in a custom uiview and uiimageview but the sticker stuck.cant move or scale. any idea to make this happened?