如何遍历View上所有的UIButton

2025-04-08 09:28:39
推荐回答(1个)
回答1:

for (id obj in self.view.subviews) {
if ([obj isKindOfClass:[UIButton Class]]) {
UIButton* theButton = (UIButton*)obj;
theButton.xxx = ooo;
}
}

大概就这样 ,你试试