单击更改SwRevealViewController图标图像 [英] Change SwRevealViewController Icon Image on Click

查看:58
本文介绍了单击更改SwRevealViewController图标图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将SwRevealViewController SideMenu单击按钮更改为此按钮,然后再次按下该按钮恢复为正常.怎么可能?我应该在哪里更改SwRevealViewController.m文件中的代码?

I would like to change the SwRevealViewController SideMenu click button to this when I click it and back to normal on pressing it again.How is it possible?Where Should I change the code in SwRevealViewController.m file?

推荐答案

//查看是否加载了此内容
//Swift 4.2

//View Did load add this
// Swift 4.2

func viewDidLoad(){

func viewDidLoad() {

super.viewDidLoad()让leftMenuItem = UIBarButtonItem(image:UIImage(named:"menu"),样式:.plain,目标:recoverViewController,操作:#selector(SWRevealViewController.revealToggle(_ :)))navigationItem.setLeftBarButton(leftMenuItem,animation:true)

super.viewDidLoad() let leftMenuItem = UIBarButtonItem(image: UIImage(named: "menu"), style: .plain, target: revealViewController, action: #selector(SWRevealViewController.revealToggle(_:))) navigationItem.setLeftBarButton(leftMenuItem, animated: true)

}

这篇关于单击更改SwRevealViewController图标图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆