
自定义leftBarButtonItem左边不可点
UIButton*backViewBtn=[UIButtonbuttonWithType:UIButtonTypeCustom];backViewBtn.frame=CG...
UIButton* backViewBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backViewBtn.frame = CGRectMake(0, 0, 17, 17);
[backViewBtn setImage:image forState:UIControlStateNormal];
[backViewBtn addTarget:selft action:
@selector(backView)
forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backViewBtn];
self.navigationItem.leftBarButtonItem = backItem; 展开
backViewBtn.frame = CGRectMake(0, 0, 17, 17);
[backViewBtn setImage:image forState:UIControlStateNormal];
[backViewBtn addTarget:selft action:
@selector(backView)
forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backViewBtn];
self.navigationItem.leftBarButtonItem = backItem; 展开
1个回答
展开全部
[backViewBtn addTarget:selft action: 这个地方self写错了,除了这个地方,其他我测试的没有问题,如果修改了还有问题看下是不是照片的问题,或者控制器类型有没有指定对
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询