我可以更改圆形标记中的文本颜色和大小。我已经使用了第三方图书馆

时间:2019-06-27 13:42:21

标签: swift4

我可以更改圆形标记的文字颜色和文字大小。我已经使用了第三方图书馆。这是该库https://github.com/digital-horizon/RoundCoachMark.Please的链接帮助我吗?

我尝试过改成图书馆但没有解决办法

import UIKit
import RoundCoachMark
class ViewController: UIViewController {
    
    
    @IBOutlet var marksContainer: UIView!
    @IBOutlet weak var myButton: UIButton!
     private var coachMarker:CoachMarker?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        setupCoach()

        // Do any additional setup after loading the view, typically from a nib.
    }

    
    private func createCoachMarker()
    {
        if let nav_controller = navigationController
        {
            nav_controller.view.addSubview(marksContainer)
           // marksContainer.constrainFill(padding:CGPoint.zero)
            nav_controller.view.layoutIfNeeded()
        }
        else
        {
            self.view.addSubview(marksContainer)
           // marksContainer.constrainFill(padding:CGPoint.zero)
            self.view.layoutIfNeeded()
        }
        
        coachMarker = CoachMarker(in:marksContainer, infoPadding:20)
        
        guard let marker = coachMarker,
            let info_view = marker.currentInfoView else {return}
        info_view.setTitleStyle(font: UIFont(name:"Verdana", size:50) ?? UIFont.systemFont(ofSize: 20), color: UIColor.green)
        info_view.setInfoStyle(font: UIFont(name:"Verdana", size:50) ?? UIFont.systemFont(ofSize: 16), color: UIColor.white)
    }
    
    func setupCoach() {
        
        createCoachMarker()
        coachMarker = CoachMarker(in: marksContainer, infoPadding:20)
        coachMarker!.addMark(title:" Menu", info:"Tap the icon to open Menu Page.",
                             control:myButton)
        coachMarker?.tapPlay(autoStart:true, completion:{print("tapPlay finished")})
    }
}

不更改颜色和文本字体。不显示任何效果

0 个答案:

没有答案