iphone uitabbar 菜单选项而不是视图
我有一个带有 6 个选项卡的选项卡栏控制器。第 6 个选项卡我只想执行一个操作(例如评价此应用程序),而不是移动到新视图。
选项卡栏元素需要有一个视图对象,所以有什么方法可以解决这个问题,直接调用将执行操作的选择器。
编辑: 这是我想从第六个选项卡调用的选择器,并继续保留在当前视图中。
-(void)action_rateThisApp:(id)sender {
NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
str = [NSString stringWithFormat:@"%@/wa/viewContentsUserReviews?", str];
str = [NSString stringWithFormat:@"%@type=Purple+Software&id=", str];
// Here is the app id from itunesconnect
// http://itunes.apple.com/us/app/cricbuzz-cricket-scores-news/id360466413?mt=8
str = [NSString stringWithFormat:@"%@360466413", str];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
I have a tab bar controller with 6 tabs. The 6th tab I want to simply do an action (like rate this app) and not move to a new view.
The tab bar elements need to have a view object, so is there any way I can work around this to directly call a selector which will perform an action.
EDIT:
Here is the selector I would like to call from my 6th tab and continue remain on the current view.
-(void)action_rateThisApp:(id)sender {
NSString *str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
str = [NSString stringWithFormat:@"%@/wa/viewContentsUserReviews?", str];
str = [NSString stringWithFormat:@"%@type=Purple+Software&id=", str];
// Here is the app id from itunesconnect
// http://itunes.apple.com/us/app/cricbuzz-cricket-scores-news/id360466413?mt=8
str = [NSString stringWithFormat:@"%@360466413", str];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以实现委托函数
来拦截选项卡栏项目触摸。从那里你可以做任何你想做的事。您可以生成用于对应用程序进行评级所需的界面视图,并将其添加到主窗口(以便它叠加在当前视图上,无论您当前位于哪个选项卡上)。
You can implement the delegate function
To intercept the tab bar item touch. From there you can do whatever you want. You can generate the interface view you want for rating your app and add it to your main window (so that it is superimposed on the current view, whichever tab you are currently on).