How To Replace UITableView With Image?(如何用图片替换 UITableView?)
问题描述
在用户编辑并向其添加数据之前,我有一个默认为空白的 UITableView.我想显示一个带有说明的图像,直到用户编辑它.
I have a UITableView that is blank be default until the user edits and adds data to it. I want to show an image with instructions that is shown until the user edits it.
图片的大小非常适合导航栏和标签栏之间.
The size of the picture is so it fits under perfectly between the nav bar and the tab bar.
有没有办法以编程方式做到这一点?
Is there a way to do this programmatically?
推荐答案
你可以使用 removeFromSuperview 从超级视图中移除 UITableView 然后添加你的 UIImageView代码>.
you can use removeFromSuperview to remove UITableView from super view then add your UIImageView.
使用下面的代码:
-(void) NeedView:(BOOL) aIsImageView
{
if(aIsImageView)
{
[m_TableView removeFromSuperview];
[self.view addSubviews:m_ImageView];
}
else
{
[m_ImageView removeFromSuperview];
[self.view addSubviews:m_TableView];
}
}
这篇关于如何用图片替换 UITableView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何用图片替换 UITableView?
基础教程推荐
- NSString intValue 不能用于检索电话号码 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
