Ios 全屏显示屏幕的非活动部分
我试着在全屏上放一张有按钮的图片来做动作 以下是我的结果截图: 我的问题是第一行(最高)上的按钮不可触摸。 它似乎在顶部布局上没有任何动作 这是我的密码:Ios 全屏显示屏幕的非活动部分,ios,objective-c,click,fullscreen,Ios,Objective C,Click,Fullscreen,我试着在全屏上放一张有按钮的图片来做动作 以下是我的结果截图: 我的问题是第一行(最高)上的按钮不可触摸。 它似乎在顶部布局上没有任何动作 这是我的密码: - (void)showActionsForGlobalFullScreen:(UIGestureRecognizer *)gestureRecognizer { //LEFT UIImage* cancelImage = [UIImage imageNamed:@"cancel.png&quo
- (void)showActionsForGlobalFullScreen:(UIGestureRecognizer *)gestureRecognizer {
//LEFT
UIImage* cancelImage = [UIImage imageNamed:@"cancel.png"];
CGRect frameimg = CGRectMake(3, 3, cancelImage.size.width, cancelImage.size.height);
UIButton *cancelButton = [[UIButton alloc] initWithFrame:frameimg];
UIImage* flagImage = [UIImage imageNamed:@"flag.png"];
CGRect frameimg2 = CGRectMake(3, 40, flagImage.size.width, flagImage.size.height);
UIButton *flagButton = [[UIButton alloc] initWithFrame:frameimg2];
[cancelButton addTarget:self action:@selector(closeFullView:) forControlEvents:UIControlEventAllTouchEvents];
[cancelButton setBackgroundImage:cancelImage forState:UIControlStateNormal];
[flagButton addTarget:self action:@selector(displayFlag:) forControlEvents:UIControlEventAllTouchEvents];
[flagButton setBackgroundImage:flagImage forState:UIControlStateNormal];
//RIGHT
UIImage *exitFullScreenImage = [UIImage imageNamed:@"exitFullScreen.png"];
CGRect frameimg3 = CGRectMake(fullScreenViewFromVC.frame.size.width - 25 , 3, exitFullScreenImage.size.width, exitFullScreenImage.size.height);
UIButton *exitFullScreenButton = [[UIButton alloc] initWithFrame:frameimg3];
UIImage *commentImage = [UIImage imageNamed:@"comment.png"];
CGRect frameimg4 = CGRectMake(fullScreenViewFromVC.frame.size.width - 25 , 40, commentImage.size.width, commentImage.size.height);
UIButton *commentButton = [[UIButton alloc] initWithFrame:frameimg4];
[exitFullScreenButton addTarget:self action:@selector(exitFullScreenPhoto:) forControlEvents:UIControlEventAllTouchEvents];
[exitFullScreenButton setBackgroundImage:exitFullScreenImage forState:UIControlStateNormal];
[commentButton addTarget:self action:@selector(diplayComments:) forControlEvents:UIControlEventAllTouchEvents];
[commentButton setBackgroundImage:commentImage forState:UIControlStateNormal];
//[actionsView addSubview:flagButton];
[fullScreenViewFromVC addSubview:cancelButton];
[fullScreenViewFromVC addSubview:flagButton];
[fullScreenViewFromVC addSubview:exitFullScreenButton];
[fullScreenViewFromVC addSubview:commentButton];
}
重要提示:
fullscreenview fromvc
是一个自己的类,扩展了UIView
,并在我的控制器上实例化。
基本上,我是通过UITableViewCell
我使用这个fullscreenview fromVC
变量将当前选定单元格中的数据存储到控制器中
谢谢你的帮助。最后,我不得不隐藏另一个视图。 我认为在全屏中更改视图的de
zPosition
应该足够了,但事实并非如此
问题已解决。请提供如何生成此接口的相关代码;事实上,没有足够的信息来正确诊断您的问题意味着只有一个
ui按钮
不触发操作?并显示您的代码iOS状态栏不包括您的按钮吗?我已经添加了我的代码,但它是一个基本的。在调用此方法之前,我已经完成了[[UIApplication sharedApplication]setStatusBarHidden:YES]