标签栏控制器 - 切换一个选项卡内的UIView [英] Tab Bar Controller- switch UIView within one tab

查看:151
本文介绍了标签栏控制器 - 切换一个选项卡内的UIView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确定这里是我的应用程序设置:
厦门国际银行二的

ok here is my applications setup: Two xib's

的MainWindow.xib
NewsletterView.xib

MainWindow.xib NewsletterView.xib

设置如下:
的MainWindow.xib
文件的所有者
急救员
该代表
窗口
标签栏控制器 - 设置加载从的.xib的标签
 两个标签-Newsletter
           - 地图

Set up as follows: MainWindow.xib Files owner First Responder The Delegate Window Tab Bar Controller--setup to load tabs from .xib's Two tabs -Newsletter -Map

我不关心的映射选项卡。

I'm not concerned about the Map tab.

在NewsletterView.xib(我确实有h和.m文件设置)

Within the NewsletterView.xib ( i do have the .h and .m files setup)

文件所有者设置了通过接口生成器类NewsletterViewController。结果
急救员结果
而两种观点:结果
通过IBOutlet中查看 - 设置为NewsSignUpView - 这是第一个观点,即所选选项卡上加载结果。
视图 - 通过IBOutlet中设置为NewsReaderView

Files owner set up with class NewsletterViewController via interface builder.
First Responder
and Two views:
View- setup as NewsSignUpView via IBOutlet - this is the first view that loads on the selected tab.
View - setup as NewsReaderView via IBOutlet

我希望能够在水平方向点击NewsSignUpView一个按钮(通过IBAction为分配)翻转显露NewsReaderView。

I want to be able to click a button (assigned via IBAction) on NewsSignUpView the flip horizontally to reveal NewsReaderView.

这是我迄今为止:

-(IBAction) revealNewsReaderView 
{CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromLeft forView:newsSignUpView cache:YES];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:1.0];  
[self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
[UIView commitAnimations];
}

这翻转的观点,但不改变显示的视图。

This Flips the view but doesn't change the view shown.

任何人都可以提供一些code,或指出哪里我去错了?

Can anyone provide some code, or point out where im going wrong?

先谢谢了。

推荐答案

您可以下载苹果的样本,看看在执行同一帧两个视图之间翻转的。
http://developer.apple.com/library/ios/#sample$c$c/UICatalog/Introduction/Intro.html

You can download the apple's sample to see implementation of flipping between two views in same frame. http://developer.apple.com/library/ios/#samplecode/UICatalog/Introduction/Intro.html

这篇关于标签栏控制器 - 切换一个选项卡内的UIView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆