03 2014 档案

摘要:-(void) tapClick:(UITapGestureRecognizer *)tap{ [UIViewbeginAnimations:@"exitApplication"context:nil]; [UIViewsetAnimationDuration:0.5]; [UIViewsetAnimationDelegate:self]; [UIViewsetAnimationTransition:UIViewAnimationCurveEaseOutforView:self.view.windowcache:NO]; [UIView setAnimation... 阅读全文
posted @ 2014-03-27 11:13 墨禾米说 阅读(189) 评论(0) 推荐(0) 编辑
摘要:下面举个简单的例子来说明在iOS7.0和iOS6.1(以及更低版本)之间的适配问题(用的是xcode5.0,里边有6.1和7.0两个版本的sdk)新建一个工程,默认的development target,base sdk以及模拟器的版本都是7.0,在AppDelegate中的didFinishLaunchingWithOptions方法里写 self.window.tintColor=[UIColorredColor]; 然后运行,这样是没有任何错误的。接下来将development target,base sdk以及模拟器的版本都改成6.1(注意默认的xcode是没有6.1的sdk的,需要. 阅读全文
posted @ 2014-03-27 11:11 墨禾米说 阅读(267) 评论(0) 推荐(0) 编辑
摘要:UISearchBar 详解最近用到搜索功能。于是,经过不断的研究,终于,有点懂了。那就来总结一下吧,好记性不如烂笔头!搜索,无疑可以使用UISearchBar控件!那就先了解一下UISearchBar控件吧!UISearchBar控件就是要为你完成搜索功能的一个专用控件。它集成了很多你意想不到的功能和特点!首先,还是来普及一下UISearchBar控件API相关的属性和方法吧!UISearchBar属性相关_searchBar= [[UISearchBaralloc]initWithFrame:CGRectZero];//初始化,不解释[self.searchBarsetPlaceholde 阅读全文
posted @ 2014-03-11 20:32 墨禾米说 阅读(535) 评论(0) 推荐(1) 编辑
摘要:在UITextView里没有UITextField里的- (BOOL)textFieldShouldReturn:(UITextField *)textField;直接的响应事件;那么在TextView里呢用: - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; { if ([@"\n" isEqualToString:text] == YES) { [_feedBackTextView ... 阅读全文
posted @ 2014-03-09 19:40 墨禾米说 阅读(379) 评论(0) 推荐(0) 编辑
摘要:有时一个UILable的text内容是变化的,而且差异有很大,需求上要求UILabel的大小高宽能够自适应text的内容。代码例子:myLable=[[UILabelalloc]initWithFrame:CGRectMake(0,23,175,33)];[myLablesetFont:[UIFontfontWithName:@"Helvetica"size:10.0]];[myLablesetNumberOfLines:0];[myLablesetBackgroundColor:[UIColorclearColor]];[myAdViewaddSubview:myLabl 阅读全文
posted @ 2014-03-07 15:54 墨禾米说 阅读(366) 评论(0) 推荐(0) 编辑
摘要:self.edgesForExtendedLayout = UIRectEdgeNone;就这么简单! 阅读全文
posted @ 2014-03-06 19:46 墨禾米说 阅读(540) 评论(0) 推荐(0) 编辑
摘要:setMasksToBounds在IB中,当你使用Custom类型的Button时,你可以指定按钮的背景色。但当你运行时按钮就失去了圆角特性,你看到的仅仅是一个方块。因为custombutton没有定义任何属性默认值。你必须自己去定义它们,这就需要使用Core Animation Layer。提示:编写代码之前,需要导入QuartzCore框架到工程中,然后#import。我会通常会把它放在.pch文件中。IB没有干的事情,你只能通过代码来做。例如,如果你想做一个圆角且红色背景的按钮,你需要将按钮链接到你的viewcontroller的出口中,然后在Xcode中通过它的layer属性修改按钮的 阅读全文
posted @ 2014-03-04 11:21 墨禾米说 阅读(480) 评论(0) 推荐(0) 编辑
摘要:1 1.UITextField的初始化和设置 2 textField = [[UITextField alloc] initWithFrame:CGRectMake(120.0f, 80.0f, 150.0f, 30.0f)]; 3 [textField setBorderStyle:UITextBorderStyleRoundedRect]; //外框类型 4 5 textField.placeholder = @"password"; //默认显示的字 6 7 textField.secureTextEntry = YES; //密码 8 ... 阅读全文
posted @ 2014-03-02 19:51 墨禾米说 阅读(375) 评论(0) 推荐(0) 编辑