- 博客(24)
- 收藏
- 关注
原创 cocos2d XML读取
//读取XMLCCDictionary* pDict = CCDictionary::createWithContentsOfFile("strings.xml");CCString* pStr1 = CCString::createWithFormat(((CCString*)pDict->objectForKey("diyLevel"))->getCString());CCLabe
2014-01-15 17:33:20 449
转载 ios尺寸大集合
元素控件尺寸(pts)Window(含状态栏)320 x 480Status Bar的高度(横、竖屏)20Navigation Bar的高度(横屏)44Navigation Bar的高度(竖屏)32含Prompt的Navigation Bar的高度(横、竖屏)74
2013-12-23 14:08:16 535
转载 ios检测有无网络连接
第一种方法: [cpp] view plaincopy+(BOOL)connectedToNetwork{ struct sockaddr_in zeroAddress; bzero(&zeroAddress, sizeof(zeroAddress)); zeroAddress.sin_len = sizeof(zeroAddress);
2013-12-20 16:09:47 574
原创 CALayer
CALayer *sublayer = [CALayer layer]; sublayer.backgroundColor = [UIColor blueColor].CGColor; sublayer.shadowOffset = CGSizeMake(0, 3); sublayer.shadowRadius = 5.0; sublayer.shadowC
2013-12-20 12:38:36 454
原创 sdwebimage
清除缓存:[[SDImageCache sharedImageCache] clearDisk];[[SDImageCache sharedImageCache] clearMemory];
2013-12-20 09:45:32 404
原创 判断是不是iPhone5
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
2013-12-19 10:11:31 532
原创 禁止webview拖动
//Before iOS 5for (id subview in webView.subviews) if ([[subview class] isSubclassOfClass: [UIScrollView class]]) ((UIScrollView *)subview).bounces = NO; //After iOS 5webView.scrollVie
2013-12-17 16:51:24 1479
原创 在label上画线
UIImageView *imageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 240, 20)]; imageView.center = CGPointMake(285, 45); [sectionView addSubview:imageView];
2013-12-16 19:08:57 876
原创 打印服务器返回的错误json
//更新个人信息- (void)UpdateUserInfo:(void (^)(int status,NSString *NickName,NSString *FaceID,int gender,NSString *errMsg,NSError *error))block parameters:(NSDictionary*)parms{ NSString *url=[NSStr
2013-12-10 20:18:10 716
原创 加载的菊花
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self]; [self addSubview:hud]; [hud show:YES];[hud hide:YES];
2013-12-06 19:59:23 489
原创 请求的block形式
#import "AFAppAPIHeader.h"#import "NSString+MD5.h"#import "AFNetworking.h"#define ACTIVITY_ANNOUNCEMENT_KEY @"3bde1c26e7" //活动公告请求密钥static NSString * const
2013-12-06 14:19:31 750
原创 隐藏键盘
//隐藏键盘-(void)hidenResponder{ [PassWordTex resignFirstResponder]; [hall_safebox_takeMoney_Tx resignFirstResponder]; [hall_safebox_safeBox_Tx resignFirstResponder]; [
2013-12-06 13:49:25 472
原创 UITableView cell上的button和label问题
int isGet = [[dic objectForKey:@"IsGet"] intValue]; if (isGet == 0) { [cell.takeTaskButton setTitle:@"已完成" forState:UIControlStateNormal]; cell.completeLabel.text = @"";
2013-12-06 10:57:19 577
原创 设置按钮的标题多行显示
[cell.takeTaskButton setTitle:@"进行中 \r\r 3/5" forState:UIControlStateNormal]; cell.takeTaskButton.titleLabel.numberOfLines=3;
2013-12-03 18:53:09 965
转载 提示框第三方库之MBProgressHUD
MBProgressHUD是一个开源项目,实现了很多种样式的提示框,使用上简单、方便,并且可以对显示的内容进行自定义,功能很强大,很多项目中都有使用到。到GitHub上可以下载到项目源码https://github.com/jdg/MBProgressHUD,下载下来后直接把MBProgressHUD.h和MBProgressHUD.m拖入工程中就行,别忘了选择拷贝到工程。完了在需要使用的地方导入
2013-12-03 17:24:19 441
原创 将按钮灰掉 即设置不可点击状态
//按钮不可点击 ensureBtn.enabled = NO; //按钮可点击 ensureBtn.enabled = YES;
2013-12-03 15:23:14 3162
原创 把图片呈现圆角
UIView *usercontentview = [[UIView alloc]initWithFrame:ccr(0, 0, 82, 82)]; usercontentview.center = ccp(P_WIDTH_2 - 111,112); usercontentview.layer.cornerRadius = 2.0; userc
2013-11-30 14:09:43 451
原创 判断是不是ios7
if ([[[UIDevice currentDevice] systemVersion] floatValue] == 7.0) {} else{}
2013-11-29 12:35:03 518
原创 ios 图片动画
animationArray = [[NSMutableArray alloc]initWithCapacity:0]; for (int i = 0; i { NSString *str; if (i { str = [NSString stringWithFormat:@"hal
2013-11-28 15:46:24 434
原创 ios播放声音
NSString *path = [[NSBundle mainBundle] pathForResource:@"dealcard" ofType:@"m4a"]; NSURL *url = [NSURL fileURLWithPath:path]; SystemSoundID outSystemSoundID; AudioServicesCreateSystemS
2013-11-27 15:40:40 768
原创 抖动动画效果
- (void)viewDidLoad{ [super viewDidLoad]; CALayer *firstLay = [self.view layer]; CGPoint postLay = [firstLay position]; CGPoint y = CGPointMake(postLay.x-50, postLay.y); CGP
2013-11-27 10:54:16 591
转载 MD5加密
@interface NSString (MD5)- (NSString *)MD5Digest;@end#import #import "NSString+MD5.h"@implementation NSString (MD5)- (NSString *)MD5Digest{ const char* input = [self
2013-11-27 10:36:48 431
转载 自定义progress
#import @interface MCProgressBarView : UIView- (id)initWithFrame:(CGRect)frame backgroundImage:(UIImage *)backgroundImage foregroundImage:(UIImage *)foregroundImage;@property (nonatomic, a
2013-11-27 10:27:30 606
原创 改变textField的占位符字体的大小和颜色(重绘)
#import @interface myTextField : UITextField@property(nonatomic, retain) UIColor *placeholderColor;@property(nonatomic, retain) UIFont *placeHolderFont;@end#import "myTextFiel
2013-11-27 10:21:53 1998
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人