技术开发 频道

新手必读:iPhone SDK示例代码解析

  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];

 

  查找Subviews(Detecting Subviews)

  我们可以通过循环来查找一个已经存在的View。当我们使用view的tag属性的话,就很方便实现Detect Subviews。

for (UIImageView *anImage in [self.view subviews]) {
    
if (anImage.tag == 1) {
        
// do something
    }
}

 

  手册文档

  Official Apple How-To's

  Learn Objective-C

0
相关文章