NAKPlaybackIndicatorView icon indicating copy to clipboard operation
NAKPlaybackIndicatorView copied to clipboard

Positioning error with safe area layout?

Open ronwood opened this issue 6 years ago • 0 comments

I am using the Xcode 9.4.1 with storyboard and safe area layout and the following code to position the playback indicator on my own "small" view:

    NAKPlaybackIndicatorViewStyle *style = [NAKPlaybackIndicatorViewStyle iOS10Style];
    NAKPlaybackIndicatorView *indicator = [[NAKPlaybackIndicatorView alloc] initWithStyle:style];
    indicator.translatesAutoresizingMaskIntoConstraints = YES;  
    [self.view addSubview:indicator];
    [indicator sizeToFit];
    indicator.frame = _myPlaybackIndicatorView.frame;
    indicator.state = NAKPlaybackIndicatorViewStatePlaying;

But the indicator is not positioned as expected in the middle of the "myPlaybackIndicatorView.frame" but somewhere else. I think the problem is regarding the safe area. What would be the best practice to position the playback indicator "over" a view?

Not displayed correct:

screen shot 2018-09-07 at 00 07 05

Displayed as expected:

screen shot 2018-09-07 at 00 07 45

ronwood avatar Sep 06 '18 22:09 ronwood