如何设置为分组表视图的背景图像? [英] How do I set a background image for a grouped table view?

查看:133
本文介绍了如何设置为分组表视图的背景图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了使用自定义图像作为背景分组的UITableView一些iPhone应用程序,而不是标准的灰线。

I've seen some iPhone applications that use a custom image as the background for a grouped UITableView, instead of the standard gray lines.

这是如何实现的?

推荐答案

在另一个项目中(使用2.2.1开发的),我设置我的的UITableView'的背景这样做不透明度为0%,然后使用Interface Builder只是层次感的UIImageView 后面。这让我有一个固定的背景下,无论表的状态。您还可以设置的UITableView 是一个图像的背景代替,但与表背景滚动。 (我没有code的时刻派上用场,但我得到了尖端的苹果开发者论坛而回)。

In another project (developed using 2.2.1) I did this by setting my UITableView's background opacity to 0%, and then simply layering a UIImageView behind it using Interface Builder. This allowed me to have a fixed background regardless of the table state. You can also set the background of the UITableView to be an image instead, but then the background scrolls with the table. (I don't have the code handy at the moment, but I got the tip a while back on the Apple developer forums).

请注意,这可能会导致一些性能问题。苹果不鼓励使用透明尽可能因为在pre-3GS型号GPU的不是特别结实。

Note that this can cause some performance issues. Apple discourages using transparency whenever possible because the GPUs on the pre-3GS models aren't particularly beefy.

这篇关于如何设置为分组表视图的背景图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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