问题
The title says it all! but to be more clear, please check this screenshot. This is a 360 video playback using the Google VR https://developers.google.com/vr/ios/ but I want to know if it is possible to remove this little (info) button? and instead overlay our own set of video controlers?
回答1:
Google allow you to create a custom GVRView which doesn't have the (i) icon - but it involves creating your own OpenGL code for viewing the video.
A hack working on v0.9.0 is to find an instance of QTMButton:
let videoView = GVRVideoView(frame: self.view.bounds)
for subview in self.videoView.subviews {
let className = String(subview.dynamicType)
if className == "QTMButton" {
subview.hidden = true
}
}
It is a hack though so it might have unintended consequences and might not work in past or future versions.
回答2:
GVRVideoView *videoView = [[GVRVideoView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height)];
for (UIView *view in videoView.subviews) {
if ([view isKindOfClass:[UIButton class]] ) {
if ([NSStringFromClass([view class]) isEqualToString:@"QTMButton"] ) {
[view removeFromSuperview];
}
}
}
回答3:
Well, I have an answer to my own question. Alright, the (i) button cannot be removed. at leased not for now. check this answer
Hi. The (i) is intentional and designed to let users and other developers understand the feature. It links to a Google help center article. We do not currently allow developers to disable it.
https://github.com/googlevr/gvr-ios-sdk/issues/9#issuecomment-208993643
来源:https://stackoverflow.com/questions/37374652/is-it-possible-to-remove-the-i-info-button-and-place-some-video-controllers-ov