如何使用 UINavController 和 UITableView 创建 UIView [英] how to create a UIView with a UINavController and a UITableView

查看:25
本文介绍了如何使用 UINavController 和 UITableView 创建 UIView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,当我按下i"按钮时,要显示关于应用程序"视图,我需要一个带有背景图像、UINavigationController 和 UITableView 的视图.我如何使用 InterfaceBuilder 或以编程方式实现这一目标?这不是在 AppDelegate 中完成的.我需要在视图上完成.我有以下代码,但它只创建了 UINavController 和 UITableView.但是使用此代码我无法将 UIImage 放在后台:

I have an App and, when I press the 'i' button, to show the About App view, I need to have a view, with a background image, with a UINavigationController and a UITableView. How can I achieve that, with InterfaceBuilder, or progamatically? It's not done in AppDelegate. I need it to be done on a view. I have the following code, but it only creates the UINavController and the UITableView. But with this code I'me unable to put a UIImage in the background:

UITableViewController *tableViewController = [[UITableViewController alloc] initWithStyle: UITableViewStyleGrouped];
tableViewController.title = @"About";

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: tableViewController];

navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navController animated:YES];

[navController release];
[tableViewController release];

我该怎么做?

谢谢,RL

推荐答案

不确定这是否有效,但值得一试:

Not sure if this will work but worth at try:

tableViewController.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"whatever.png"]];

这篇关于如何使用 UINavController 和 UITableView 创建 UIView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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