How to get button to display different video according to the row it is pressed in?

前端 未结 3 389
耶瑟儿~
耶瑟儿~ 2020-12-20 10:01

Currently I have my code setup to where in each table view cell there is a button that displays a video after is pressed. Each table view cell row contains the button (there

3条回答
  •  时光说笑
    2020-12-20 10:29

    Setup an array to put your videos' paths into, and its indexe should match the index of the cell. In addition, you can pass the row number of the cell to the button inside as its tag. So when you tap on that button, you can find a specific video path in the array through the button's tag.

提交回复
热议问题