I am trying to add buttons to the bottom toolbar of UIVideoEditorController. Is this Possible? Can I modify/add buttons to this toolbar?

UIVideoEditorController

有帮助吗?

解决方案

Apple Docs clearly mention

Important: The UIVideoEditorController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private; do not modify the view hierarchy. This class does not support modifications to its appearance by use of overlay views.

So basically its not possible.

其他提示

Here I leave a possible solution, but always keep in mind the warning from Apple. In this case, I'm changing the background color of the toolbar, but it should work with any modifications you want.

 - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{

    [self changeBakcgroundColorOfView:navigationController.topView withColor:[UIColor redColor]];
}

- (void) changeBakcgroundColorOfView:(UIView *)view withColor:(UIColor*)color{

    for (UIView *subview in view.subviews) {

        if ([NSStringFromClass([subview class]) isEqualToString:@"UIToolbar"]) {

            UIToolbar *toolbar = (UIToolbar *)subview;
            toolbar.backgroundColor = color;
            toolbar.barTintColor = color;
        }

        [self changeBakcgroundColorOfView:subview withColor:color];
    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top