首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >RootView中的UIImageView

RootView中的UIImageView
EN

Stack Overflow用户
提问于 2011-03-09 21:26:22
回答 1查看 156关注 0票数 1

我想让我的RootView在桌子上方显示一个UIImage。我该怎么做呢?

EN

回答 1

Stack Overflow用户

发布于 2011-03-10 00:18:21

您应该使用setBackgroundView方法。

下面是一个小示例:

代码语言:javascript
复制
// my image
UIImage *image = [[[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"my_image" ofType:@"png"]] autorelease];

// an imageView to put the imagen on
UIImageView *imageView = [[[UIImageView alloc] initWithImage:image] autorelease];

// we set the background of the table with the imageView    
[myTable setBackgroundView:imageView];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5246453

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档