how can i get object from tag?

后端 未结 2 1289
自闭症患者
自闭症患者 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:41

    UIButton *button = (UIButton *)[myView viewWithTag:myTag];
    [button setImage:... forState:...];
    

提交回复
热议问题