8000 Pulse is not centered to view · Issue #55 · shu223/Pulsator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Pulse is not centered to view #55
Open
@kevinluscii

Description

@kevinluscii

Hi, I'm trying to get a nice pulse below a round avatar view. The UIImageView itself is a rectangle spanning the entire screen, its image is a circle with aspect fit. When I add the pulsator view like this:

    let pulsator = Pulsator()
    pulsator.radius = 500
    pulsator.numPulse = 3
    pulsator.pulseInterval = 3
    pulsator.animationDuration = 5
    pulsator.backgroundColor = UIColor(red: 0, green: 0.623, blue: 0.890, alpha: 0.3).cgColor
    self.avatarImageView.addSublayer(pulsator)
    pulsator.start()

It works but the pulse comes from the top left of the UIImageView. I want it to spawn pulses from the center of the image, which is also the center of the UIImageView itself. How can I change the pulsator's position? Or how can I center it properly to the view?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0