上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
  2012年7月4日
摘要: iPad的UIActionSheet方法中没有cancel,点击popover其他区域即消失,但是,往往其他区域有Button,比如:UINavigationBarItem 的leftBarButton 或者rightBarButton,这时点击,就会出现程序崩掉。方法:(在点击的button方法中添加如下代码:)if ([self.actionSheet isVisible]) { [self.actionSheet dismissWithClickedButtonIndex:self.actionSheet.cancelButtonIndex animated:YES]; }此方法引用于: 阅读全文
posted @ 2012-07-04 19:01 tx天翔 阅读(1030) 评论(0) 推荐(0) 编辑
摘要: - (void)keyboardWillChangeFrame:(NSNotification *)notification{ // if(!isDisplayFaceBox){ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { #endif #if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_2 NSValue *keyboardBoundsValue = 阅读全文
posted @ 2012-07-04 12:56 tx天翔 阅读(4031) 评论(0) 推荐(0) 编辑
  2012年7月3日
摘要: 文字属性textplaceholder //默认使用70%灰色 font textColor textAlignment文字大小adjustsFontSizeToFitWidthminimumFontSize编辑行为editing //是否正在编辑(read-only)clearsOnBeginEditing展现形态borderStyle //默认UITextBorderStyleNone,是UITextBorderStyleRoundedRect时自定义的background无效backgrounddisabledBackgroundproperty //backgrou... 阅读全文
posted @ 2012-07-03 11:28 tx天翔 阅读(2867) 评论(0) 推荐(0) 编辑
摘要: 重写UITextField方法:-(CGRect)textRectForBounds:(CGRect)bounds;效果如图:-------->-(CGRect)editingRectForBounds:(CGRect)bounds;@interfaceMYTextField:UITextField@end@implementationMYTextField-(CGRect)textRectForBounds:(CGRect)bounds { int margin =10; CGRect inset =CGRectMake(bounds.origin.x + margin, bounds 阅读全文
posted @ 2012-07-03 09:31 tx天翔 阅读(1406) 评论(0) 推荐(0) 编辑
  2012年6月29日
摘要: 使用普通的来CATransition实现转换效果,代码如下:CATransition *animation = [CATransition animation];[animation setDuration:0.3];[animation setType: kCATransitionMoveIn]; //kCATransitionFade,kCATransitionPush,kCATransitionReveal[animation setSubtype: kCATransitionFromTop]; //kCATransitionFromRight,kCATransitionFromLeft 阅读全文
posted @ 2012-06-29 17:51 tx天翔 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 自定义的navigationBar,设置背景方法:IOS 5.0以前的设备添加:@implementation UINavigationBar (CustomImage) - (void)drawRect:(CGRect)rect { UIImage *image = [UIImage imageNamed: @"add_nav_bg_ipad.png"]; [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; }@endIOS 5.0 以后的设备再添加:在vi 阅读全文
posted @ 2012-06-29 16:59 tx天翔 阅读(2510) 评论(0) 推荐(0) 编辑
摘要: UITableView设置背景图片:即设置tableView的backgroundViewUIView *view = [[UIView alloc] init]; view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"view_bg_ipad.png"]]; self.tableView.backgroundView = view; 阅读全文
posted @ 2012-06-29 16:53 tx天翔 阅读(5326) 评论(0) 推荐(0) 编辑
  2012年6月28日
摘要: iPhone和iPad的图标图标是IOS程序包所必需的组成部分。如果你没有提供程序所需的各种尺寸的图标,程序上传发布时可能会无法通过验证。IOS程序为兼顾不同的应用场景,定义了多个不同规格的图标,并以不同的命名区分:IOS图标尺寸一览iPhone专用程序:图标名称大小圆角用途必需Icon.png57 X 5710px用于程序商店和在iPhone/iPod Touch中显示必需Icon@2x.png114 X 11420pxIcon.png的高清模式Icon-Small.png29 X 2920px用于设置和Spotlight搜索Icon-Small@2x.png58 X 588pxIcon-S 阅读全文
posted @ 2012-06-28 11:38 tx天翔 阅读(496) 评论(0) 推荐(0) 编辑
摘要: 例子如下:NSMutableArray*buttonTitles =[NSMutableArray array];if(condition1){ [buttonTitles addObject:@"Do action 1"];}if(condition2){ [buttonTitles addObject:@"Do action 2"];}if(condition3){ [buttonTitles addObject:@"Do action 3"];}if(condition4){ [buttonTitles addObject:@& 阅读全文
posted @ 2012-06-28 09:37 tx天翔 阅读(212) 评论(0) 推荐(0) 编辑
  2012年6月26日
摘要: NSNotification的简单使用流程(例子)如下:1、在viewDidLoad添加:- (void)viewDidLoad{//添加如下 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAlertView:) name:@"showAlertView" object:nil];}2、.m文件中添加:(例子如下)- (void)showAlert:(NSString *)msg{ UIAlertView *alert = [[UIAlertView alloc] 阅读全文
posted @ 2012-06-26 10:41 tx天翔 阅读(2966) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页