작동하지 않습니다. 이제이 UIToolbarButton을 클릭하면 현재보기에서 다른보기를 열려고합니다.TapGestureRecognizer 내가 이미지를 보유하는있는 UIButton이있는 UIToolbarButton이
내 코드 :
- (IBAction)btnNowPlaying:(id)sender
{
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]
initWithTarget:self
action:@selector(openPlaying:)];
[self.view addGestureRecognizer:tap];
}
- (void)openPlaying:(UIGestureRecognizer *)sender
{
NewMainViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"Center"];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController * npvc = [storyboard instantiateViewControllerWithIdentifier:@"NowPlayingVC"];
[vc.containerView addSubview:npvc.view];
}
이 작업, btnNowPlaying가있는 UIButton에 있습니다.
바 버튼 안에 UIButton을 넣는 대신 UIBarButton 항목의 이미지 속성을 사용하는 이유는 무엇입니까? – trevorj
이미지 속성을 사용하면 이미지가 표시되지 않습니다. –
색조 색상 만 표시됩니다. –