- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 iOS 开发的新手,目前坚持创建后退按钮。我已经放了 popViewControllerAnimated 点击按钮的方法,我也在 Debug模式下测试它,后退按钮方法正在调用,但是 popViewControllerAnimated 不管用。
这是代码。
- (void)viewDidLoad
{
[super viewDidLoad];
UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake((self.view.frame.size.height-100), 30, 80, 20)];
[backButton setTitle:@"Back" forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(BackButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:backButton];
//some piece of code...
}//end of viewDidLoad method
-(void)BackButtonClicked: (id)sender{
[self.navigationController popViewControllerAnimated:YES];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"testing" message:@"some message" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:@"NO", nil];
[alert show];
}
PlaceTranslatedDetailsViewController *secondViewController =
[self.storyboard instantiateViewControllerWithIdentifier:@"placeTranslatedDetail"];
[self presentViewController:secondViewController animated:YES completion:NULL];
最佳答案
如果您的 viewcontroller
不是 rootviewcontroller
对于 uinavigationcontroller
比方法popViewControllerAnimated
不会工作。所以你需要有一个uinavigationcontroller
后面为了推送/弹出 viewcontroller
.
因此,在您的情况下,您必须使用 [self dismissViewControllerAnimated:YES completion:nil];
而不是 popViewController
因为您以模态方式呈现了一个 View Controller 。
关于ios - 后退按钮没有反应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17675560/
我正在尝试将高斯模糊添加到场景中。我正在使用此GLSL着色器:。当您提供图像作为tDiffuse纹理时,它对图像起作用,但我正在尝试将其添加为后处理效果。我试图获取摄影机的renderTarget并将
我正在做一款天气应用程序,到目前为止还不错。现在,我想通过单击按钮来呈现一些额外的信息。我有一个5天的预报,然后想显示每一天的信息。我已经成功地过滤了数据,但无法获得要渲染的数据地图。以下是我的一些代
我正在做一款天气应用程序,到目前为止还不错。现在,我想通过单击按钮来呈现一些额外的信息。我有一个5天的预报,然后想显示每一天的信息。我已经成功地过滤了数据,但无法获得要渲染的数据地图。以下是我的一些代
我在全球安装了Create Reaction应用程序。然后我就跑了。NPX创建-反应-应用JSX。它安装了大约1460个包的所有包,但没有设置Public和src文件夹。在我的JSX文件夹中,只有1:
我是一名优秀的程序员,十分优秀!