Ios 翻转图像以便在按钮上使用

Ios 翻转图像以便在按钮上使用,ios,swift,uikit,Ios,Swift,Uikit,我的应用程序中有一些按钮声明如下: let infoButton = UIButton(type: UIButtonType.InfoLight) as UIButton infoButton.addTarget(self, action: "toggleInfo", forControlEvents: UIControlEvents.TouchUpInside) self.navigationItem.rightBarButtonItem = UIBarButtonItem(customVi

我的应用程序中有一些按钮声明如下:

let infoButton = UIButton(type: UIButtonType.InfoLight) as UIButton
infoButton.addTarget(self, action: "toggleInfo", forControlEvents: UIControlEvents.TouchUpInside)
self.navigationItem.rightBarButtonItem  = UIBarButtonItem(customView: infoButton)
在将图像分配给我的导航栏之前,是否有办法从系统定义的按钮本身(例如垂直)镜像图像?

您可以尝试以下方法:

    CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI * 0.05);
    UIView *view = [buttonItem valueForKey:@"view"];
    view.transform = transform;

看看他们是如何在这里制作动画的:

我不这么认为,可能是复制品。我想翻转一个内置的图形-这里是一个系统类型按钮。你可能想尝试下载一个模板PSD并为自己导出所需的按钮。例如: