Iphone 在ipad应用程序中单击按钮打开视图(另一个xib),无需导航
点击图标时视图上有一个图像图标另一个视图其他xib会像键盘打开一样打开,它应该只覆盖屏幕底部的30%,点击任何图标时有五个图标当前图标应替换为所选图标。这是一个ipad应用程序。感谢大家Iphone 在ipad应用程序中单击按钮打开视图(另一个xib),无需导航,iphone,ios,ipad,Iphone,Ios,Ipad,点击图标时视图上有一个图像图标另一个视图其他xib会像键盘打开一样打开,它应该只覆盖屏幕底部的30%,点击任何图标时有五个图标当前图标应替换为所选图标。这是一个ipad应用程序。感谢大家 [self.view addSubview:youranotherviewcontroller.view]; 或 我建议您阅读以下苹果指南。这可能对你有更多帮助 希望这对你有帮助 ViewController *viewController=[[ViewController alloc]initWithNi
[self.view addSubview:youranotherviewcontroller.view];
或
我建议您阅读以下苹果指南。这可能对你有更多帮助
希望这对你有帮助
ViewController *viewController=[[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
viewController.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;//any type you want use that
[self presentModalViewController:viewController animated:YES];
或
我建议您阅读以下苹果指南。这可能对你有更多帮助
希望这对你有帮助
ViewController *viewController=[[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
viewController.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;//any type you want use that
[self presentModalViewController:viewController animated:YES];
我认为这行代码对你很有帮助,只要试着告诉我这在你的应用程序中是什么样子
我认为这一行代码对你很有帮助,只要试着告诉我这在你的应用程序中是什么样子。你可以使用模式视图方法来提供向上滑动的效果,或者你可以添加带有动画的sib视图,你可以检查一下-
UIView *myAnimationView = [[UIView alloc] initWithFrame:self.view.frame];
myAnimationView.backgroundColor = [UIColor blueColor];
[self.view addSubview:myAnimationView];
[myAnimationView setFrame:CGRectMake(0, 480, 320, 480)];
[myAnimationView setBounds:CGRectMake(0, 0, 320, 480)];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[myAnimationView setFrame:CGRectMake(0, 0, 320, 480)];
[UIView commitAnimations];
您可以使用模式视图方法来提供向上滑动的效果,也可以添加带有动画的sib视图,您可以对此进行检查-
UIView *myAnimationView = [[UIView alloc] initWithFrame:self.view.frame];
myAnimationView.backgroundColor = [UIColor blueColor];
[self.view addSubview:myAnimationView];
[myAnimationView setFrame:CGRectMake(0, 480, 320, 480)];
[myAnimationView setBounds:CGRectMake(0, 0, 320, 480)];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[myAnimationView setFrame:CGRectMake(0, 0, 320, 480)];
[UIView commitAnimations];
使用以下命令:-
在ViewDidLoad中,同样给出另一个ViewController的帧大小,使其仅覆盖屏幕的30%。之后:-
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
CGPoint startLocation = [touch locationInView:self.view];
if([touch view]==yourFirstImageIcon)
{
// alloc this youranotherviewcontroller in ViewDidLoad
[self presentModalViewController:youranotherviewcontroller animated:Yes];
//It will show your another View having five more icons like keyboard
}
}
使用以下命令:-
在ViewDidLoad中,同样给出另一个ViewController的帧大小,使其仅覆盖屏幕的30%。之后:-
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
CGPoint startLocation = [touch locationInView:self.view];
if([touch view]==yourFirstImageIcon)
{
// alloc this youranotherviewcontroller in ViewDidLoad
[self presentModalViewController:youranotherviewcontroller animated:Yes];
//It will show your another View having five more icons like keyboard
}
}
视图应该像键盘在视图上一样打开。使用presentModel。presentModel可以像键盘一样打开。感谢您的回复,很抱歉回答了不完整的问题,实际上我要做的是单击图像时会出现另一个视图,该视图的大小较小,包含五个图像,单击任何图像,当前图像将被ipad应用程序中选定的图像替换。请先编辑您的问题,还是我应该编辑它?我已更改了我的问题亲爱的……视图应像键盘在视图上方一样打开。使用presentModel。presentModel可以像键盘一样打开。感谢您的回复,对于这个不完整的问题,很抱歉,实际上我要做的是点击图片,另一个视图应该会出现,它的大小更小,包含五个图片,单击任何图像,当前图像将被ipad应用程序中选定的图像替换。请先编辑您的问题,还是我应该编辑它?亲爱的,我已经更改了我的问题……如果我没有按照问题进行操作,请向我解释一次。谢谢您为什么要使用另一个xib,请仅在该类中使用隐藏视图,这样更容易为您。从打开的视图中选择另一个图标时,必须显示第一个视图。@aloksinha执行此操作使用一个静态视图并将其隐藏,使用该视图并在其上添加图标,我认为这是调用另一个视图的好时机。如果我的信息对您有帮助,请将其正确显示并提高我的声誉。谢谢。如果我是回答问题时出错,请给我解释一下。谢谢你为什么要使用另一个xib?仅在该类中使用隐藏视图对你来说更容易。从打开的视图中选择另一个图标时,必须显示第一个视图。@aloksinha执行此操作使用一个静态视图并将其隐藏,然后使用该视图并在该视图上添加图标想一想好的瞬间打电话给另一个观点。如果我的信息对你有帮助,请你欢迎我,使其正确并增加我的声誉。谢谢。你应该改变你的问题。你应该改变你的问题。