chenkaijie4ever / Single-hand-Sticker

A sticker view, just like MeiTuXiuXiu, which can be scaled、rotated and moved with single finger or both hands.
Apache License 2.0
49 stars 17 forks source link

Stickers ain't shown #1

Open WinKhantAung opened 7 years ago

WinKhantAung commented 7 years ago

Hello... I just used this Single-hand-Sticker in my project and I rewrote into Swift. The problem is stickers are not shown whenever application is loaded without any error. Here are my lines of code.

 let sticker1 = StickerView();
        sticker1.delegate = self;
        sticker1.frame = CGRect(x: 0, y: 0, width: 150, height: 150);
        sticker1.contentImage = UIImage(named: "sticker1.png");
        sticker1.center = self.view.center;
        sticker1.enabledBorder = true;
        sticker1.enabledControl = true;
        self.view.addSubview(sticker1);
chenkaijie4ever commented 7 years ago

It seems nothing wrong with your code, has you ensured that the image you load isn't nil?

WinKhantAung commented 7 years ago

Yeah, I'm sure about that. It isn't nil.

chenkaijie4ever commented 7 years ago

Sry I am too busy this time.. I suggest that U can use Debug View Hierarchy to ensure that the sticker(or superView).frame is right .. Otherwise, check whether the supertView is hidden.