how can i get object from tag?

后端 未结 2 1292
自闭症患者
自闭症患者 2021-02-10 09:53

i have one view .in that view i have 2 buttons .

i know tag of that button . i want to change image of that button.

how can i change image by this tag?

2条回答
  •  长发绾君心
    2021-02-10 10:36

    UIScrollView * scView=(UIScrollView*)[self.view viewWithTag:20];
    UIButton *button = (UIButton *)[scView viewWithTag:3];
    

提交回复
热议问题