iPhone:在顶部uitableview上显示uiview时出现问题
我试图在uitableview上显示一个webview,我在Nib中设计了该视图,但我做了一些严重错误的事情,它根本不起作用 在uitableview控制器中,我执行此操作iPhone:在顶部uitableview上显示uiview时出现问题,iphone,ios,Iphone,Ios,我试图在uitableview上显示一个webview,我在Nib中设计了该视图,但我做了一些严重错误的事情,它根本不起作用 在uitableview控制器中,我执行此操作 modalWebView *webUIViewController = [[modalWebView alloc] init]; NSArray* s=[[NSBundle mainBundle] loadNibNamed:@"modalWebView" owner:webUIViewController options:
modalWebView *webUIViewController = [[modalWebView alloc] init];
NSArray* s=[[NSBundle mainBundle] loadNibNamed:@"modalWebView" owner:webUIViewController options:nil];
UIView* v= [s objectAtIndex:0];
[self showModal:v];
这就是方法
- (void) showModal:(UIView*) modalView {
UIWindow* mainWindow = (((AppDelegate_iPhone*) [UIApplication sharedApplication].delegate).window);
CGSize offSize = [UIScreen mainScreen].bounds.size;
CGPoint offScreenCenter = CGPointMake(offSize.width / 2.0, offSize.height * 1.5);
modalView.center = offScreenCenter; // we start off-screen
[mainWindow addSubview:modalView];
modalView.center=middleCenter;
}
看看我是怎么做到的:
StatusChangedMsgView *temp = [[StatusChangedMsgView alloc] initWithFrame:CGRectMake(10, 66, 300, 35)];
XUIAppDelegate *delegate = (XUIAppDelegate*)[UIApplication sharedApplication].delegate;
[delegate.window insertSubview:temp atIndex:[[delegate.window subviews]count]];
我希望它能帮助你 请访问下面的链接,我希望这将帮助您显示您的视图
有什么理由不显示viewcontroller,它用
presentModalViewController
保存webview?@rckoenes它覆盖了我不知道的整个屏幕want@XDeveloper将它添加到应用程序窗口的全部意义在于,它始终位于所有内容之上。如果只想将其放在表视图的顶部,请将其添加到视图控制器的视图[self.view addSubview:v]
。在这之前配置它的大小和坐标。@Francisco Sevillano tnx您的建议很有希望,但当我尝试时,我发现新的子视图具有mainview的滚动和反弹功能,而不是webview的滚动功能。如何克服this@XDeveloper主视图中应该有两个视图,表视图和web视图。如果要显示webview,请将其添加到主视图,而不是表视图。哦,对不起……这是: