美文网首页
Swift UIImagePickerController 修改

Swift UIImagePickerController 修改

作者: iOS_我更专业 | 来源:发表于2018-12-12 14:00 被阅读0次

方法如下:这是UINavigationControllerDelegate的一个代理方法

navigationController(_navigationController:UINavigationController, willShow viewController:UIViewController, animated:Bool)

func navigationController(_navigationController:UINavigationController, willShow viewController:UIViewController, animated:Bool) {

        ifletPLCameraView =self.findView(aView: viewController.view, withName:"CAMCameraViewControllerContainerView"){

            ifletPLCropOverlay =self.findView(aView: PLCameraView , withName:"CAMViewfinderView"){

                ifletbottomBar =self.findView(aView: PLCropOverlay , withName:"CAMBottomBar"){//拍照页面底色

                    ifletbottomBar1 =self.findView(aView: bottomBar , withName:"CUShutterButton"){//拍照按钮

                    }

                    ifletbottomBar2 =self.findView(aView: bottomBar , withName:"CAMFlipButton"){//切换摄像头

                    }

                    ifletbottomBar3 =self.findView(aView: bottomBar , withName:"CAMReviewButton"){//取消

                    }

                }

            }

        }

        ifletPLCameraView =self.findView(aView: viewController.view, withName:"PLCropOverlay"){

            ifletPLCropOverlay =self.findView(aView: PLCameraView , withName:"PLCropOverlayBottomBar"){

                ifletbottomBar =self.findView(aView: PLCropOverlay , withName:"PLCropOverlayPreviewBottomBar"){//拍照完成页面底色

                    foriteminbottomBar.subviews{

                        letbt = type(of:item)

                        letstringl = bt.description()

                        ifstringl =="UIButton"{

                            letbBtn = itemas!UIButton

                            ifbBtn.titleLabel?.text==nil{//使用照片

                                bBtn.backgroundColor=UIColor.red

                            }elseifbBtn.titleLabel?.text=="重拍"{//重拍

                            }

                        }

                    }

                }

            }

        }

    }

判断VIew方法:

funcfindView(aView:UIView,withName name:String)->UIView?{

        letcl = type(of:aView)

        letdesc = cl.description()

        print(desc)

        ifname == desc {

            returnaView

        }

        forviewinaView.subviews{

            letcl1 = type(of:view)

            letstringl = cl1.description()

            print(stringl)

            ifstringl == name{

                returnview

            }

        }

        return nil

    }

相关文章

网友评论

      本文标题:Swift UIImagePickerController 修改

      本文链接:https://www.haomeiwen.com/subject/mgguhqtx.html