Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Autolayout issues? #26

Open
sabiland opened this issue Jun 27, 2018 · 1 comment
Open

Autolayout issues? #26

sabiland opened this issue Jun 27, 2018 · 1 comment

Comments

@sabiland
Copy link

sabiland commented Jun 27, 2018

On iPad after rotations this happens (look at the image).
Is there an option to force re-layout ColorSlider?
I tried layoutIfNeeded, etc. But no success Preview UIView is not correctly repositioned upon device rotations.

The easiest way to reproduce it is like this:

  1. Make ColorSlider Autolayouted (so the width is different for specific device orientation)
  2. Rotate device (iPhone or iPad)
  3. Preview UIView is not correctly repositioned
@sabiland
Copy link
Author

sabiland commented Oct 7, 2018

I have temporarily fixe this with adding this function to ColorSlider and calling it after device rotate.

public func forceRepositionPreviewView()
    {
        let sliderProgress = gradientView.calculateSliderProgress(for: internalColor)
        centerPreview(at: CGPoint(x: sliderProgress * bounds.width, y: sliderProgress * bounds.height))
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant