如何从viewcontroller转到tableviewcontroller [英] How to go from a viewcontroller to a tableviewcontroller
问题描述
我有一个 UIViewController
,带有3个图像和3个按钮。我想要它,这样当你按下一个按钮时,它会显示 UITableViewController
中的可能项目列表,它可以填充 UIImages
。但是,每个列表将根据按下的按钮而有所不同。
I have a UIViewController
with 3 images and 3 buttons. I want it so that when you press a button it shows a list of possible items in the UITableViewController
which can fill the UIImages
. However, each list will be different depending on the button pressed.
我尝试过使用segues和模态函数而没有运气。任何人都可以帮助我吗?
I have tried using segues and the modal function with no luck. Can anyone help me?
推荐答案
制作3组图像数组,在每个按钮上单击发送相应的数组,
并且 cell.imageview.image
在indexpath的帮助下访问每个数组位置
Make 3 set of image array , on each button click send your corresponding array,
And cell.imageview.image
set image for each by accessing each postion of array with help of indexpath
这篇关于如何从viewcontroller转到tableviewcontroller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!