2011年8月12日

代码实现的事件响应

摘要: 在XCode中,使用interfacebuilder实现界面的处理比较方便(很好地实现了MVC),但是在某些时候,我们需要用代码来实现事件的绑定,特别是在动态添加控件的情况下。一个典型的代码如下:UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect];button.frame=frame;[button setTitle:@"TestButton" forState:UIControlStateNormal];button.backgroundColor=[UIColor clearColor]; 阅读全文

posted @ 2011-08-12 22:21 wljcan 阅读(399) 评论(0) 推荐(0) 编辑

UIAlertView的使用方法

摘要: UIAlertView类似于C#中的模态对话框 或 Messagebox ,但是,ios中使用起来要麻烦得多。下面这段代码是一段典型的应用:UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@"hello" message:@"ipad ,i come" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];[alert show];[alert release];但是,如果复杂一点,就麻烦了,如果上面加上几 阅读全文

posted @ 2011-08-12 18:14 wljcan 阅读(9533) 评论(1) 推荐(0) 编辑

导航