NAKPlaybackIndicatorView
NAKPlaybackIndicatorView copied to clipboard
Positioning error with safe area layout?
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:
Displayed as expected: