MPVolumeView doesn't respond to touches if it's laid out using autolayout
| Originator: | pastey | ||
| Number: | rdar://32486127 | Date Originated: | May 31 2017 |
| Status: | Open | Resolved: | false |
| Product: | iOS Media Player Framework | Product Version: | iOS 10.x |
| Classification: | Bug | Reproducible: | 100% |
If MPVolumeView is positioned on a parent view using autolayout, then one cannot move volume slider using his/her finger – volume view just won't do anything.
Example code (test project is attached too):
MPVolumeView * volumeView = [MPVolumeView new];
volumeView.showsRouteButton = NO;
[self.view addSubview:volumeView];
volumeView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:volumeView attribute:(NSLayoutAttributeCenterY) relatedBy:(NSLayoutRelationEqual) toItem:self.view attribute:(NSLayoutAttributeCenterY) multiplier:1 constant:0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:volumeView attribute:(NSLayoutAttributeLeft) relatedBy:(NSLayoutRelationEqual) toItem:self.view attribute:(NSLayoutAttributeLeft) multiplier:1 constant:20]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:volumeView attribute:(NSLayoutAttributeRight) relatedBy:(NSLayoutRelationEqual) toItem:self.view attribute:(NSLayoutAttributeRight) multiplier:1 constant:-20]];
Steps to Reproduce:
1. run example project on a device
2. try to move volume view thumb with your finger
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!