Skip to content
Piergiuseppe Longo edited this page Nov 22, 2016 · 2 revisions

FAQ

Can I cutomize HUD's frame and how?

Add the moment is not possible to change the frame, but you can always create your custom HUD extending the desired HUD and overriding layoutSubviews

class CustomFrameHUD : PKHUDProgressView{
    open override func layoutSubviews() {
        super.layoutSubviews()

        let viewWidth = bounds.size.width
        let viewHeight = bounds.size.height

        titleLabel.frame = CGRect(origin: CGPoint.zero, size: CGSize(width: viewWidth, height: titleHeight))
        imageView.frame = CGRect(origin: CGPoint(x:0.0, y:quarterHeight), size: CGSize(width: viewWidth, height: imagefHeight))
        subtitleLabel.frame = CGRect(origin: CGPoint(x:0.0, y:threeQuarterHeight), size: CGSize(width: viewWidth, height: subTitleHeight))
    }
}

Clone this wiki locally