如何为所有视图控制器创建通用 UITableView? [英] How to create common UITableView for all view controllers?

查看:34
本文介绍了如何为所有视图控制器创建通用 UITableView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何在多个 ViewControllers 中使用单个 UITableView 吗?

Does anyone have an idea about how to use a single UITableView in multiple ViewControllers?

我需要为我的所有视图控制器创建一个通用的 UITableView 并在整个应用程序中使用它.

I need to create a common UITableView for all my view controllers and use it through out the application.

感谢任何帮助.

推荐答案

使用ContainerView,你可以将ContainerView拖入你的storyboard中的ViewControllers,根据需要调整大小你需要.您在所有需要 TableView 的 ViewController 中使用 ContainerView.

Use ContainerView, you can drag ContainerView into your ViewControllers in a storyboard, adjust the size according what you need. You use the ContainerView in all that ViewController that need the TableView.

附件是我的一个应用的屏幕截图,该应用使用 ContainerView,其中在 ViewController 中包含一个 TableView.我在 2 个不同的 ViewController 中使用相同的东西.

Attached is a screen shot of one of my app that is using ContainerView that contains a TableView inside the ViewController. I am using the same thing in 2 different ViewControllers.

这篇关于如何为所有视图控制器创建通用 UITableView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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