Info button
为了更方便End-User去按,我们可以增大Info button上可以触摸的区域。
CGRect newInfoButtonRect = CGRectMake(infoButton.frame.origin.x-25,
infoButton.frame.origin.y-25, infoButton.frame.size.width+50,
infoButton.frame.size.height+50);
[infoButton setFrame:newInfoButtonRect];
infoButton.frame.origin.y-25, infoButton.frame.size.width+50,
infoButton.frame.size.height+50);
[infoButton setFrame:newInfoButtonRect];
查找Subviews(Detecting Subviews)
我们可以通过循环来查找一个已经存在的View。当我们使用view的tag属性的话,就很方便实现Detect Subviews。
for (UIImageView *anImage in [self.view subviews]) {
if (anImage.tag == 1) {
// do something
}
}
if (anImage.tag == 1) {
// do something
}
}
手册文档