如何使视图上的closures图标(红色x)?

我想做的移动Safari多页面模式相同,在前面打开的页面的右上angular的红色x,点击它closures它。

我search,但无法find任何。 这是一个开箱即装的小工具,或者我应该自定义吗?

创build一个与closures图标相同的图像(没有办法通过公共API来获取它),并将其设置为UIButton的背景。 然后,将其添加为页面的子视图。 完成。

UIButton* closeButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 25.0f, 25.0f)]; [closeButton addTarget:self action:@selector(didTapCloseButton:) forControlEvents:UIControlEventTouchUpInside]; [closeButton setBackgroundImage:[UIImage imageNamed:@"closeButton.png"] forState:UIControlStateNormal]; [self.pageView addSubview:button]; [closeButton release];