ITeye博客

代码写到地老天荒

百合不是茶 · 共 218 篇文章

微信分享点击无效

项目一直上线运行, 微信分享今天出现了bug,突然无法分享了,第一时间想到的是APP_ID被修改了(微信支付正常),然后又重新下载微信的demo,进行无尽的参数配置等各项查找,... 原因是Bitmap未指定大小导致: //解决方案: Bitmap thumbBmp = Bitmap.createScaledBitmap(shareThumb, 150, 150, false);

2017-01-19 14:36 · aandroid 微信和移动开发 · 评论(0)

百度地图 APP Scode码校验失败

http://lbsyun.baidu.com/index.php?title=androidsdk/guide/key 按照百度的说明进行操作总是230 uid: -1 appid -1 msg: APP Scode码校验失败 解决: 1) 将apk修改后缀为 .zip文件后解压; 2) 进入解压后的META-INF目录,该目录下会存在文件CERT.RSA 3) 在该目录下打开cmd,输入命令 :keytool -printcert -file CERT.RSA 这里将会显示出MD5和SHA1签名。

2016-12-22 18:04 · aandroid 微信和移动开发 · 评论(0)

Node简介(1)

研究Cocos2dx一个月终于把工程搭建起来了,主要是一些开发工具很难找到,无奈无奈 今天听一些大神说,Node节点是Cocos的核心,类似于Java的Object :节点是场景图的基本元素。场景图的基本元素必须是节点对象或者是节点对象的子类。 一些常用的节点对象:Scene, Layer , Sprite , Menu , Label . 一个节点的主要特点: 他们可以包含其他的节点对象( addChild , getChildByTag , removeChild , etc) 他们可以安排定期的回调( schedule , unschedule , etc) 他们可以执行一些动作( r…

2016-10-08 22:07 · Cocos2dx · 评论(0)

coreData的简单使用

个人对coreData技术的感觉是,麻烦, 初学者嘛?总得使用一下: coreData最核心的三个类: 1.初始化NSManagedObjectModel对象,加载模型文件,读取app中的所有实体信息 2.初始化NSPersistentStoreCoordinator对象,添加持久化库(这里采取SQLite数据库) 3.初始化NSManagedObjectContext对象,拿到这个上下文对象操作实体,进行CRUD操作 1,core的创建和插入; self.appDelegate=[UIApplication sharedApplication ].delegate; -(void)inse…

2016-03-23 23:03 · oc学习 · 评论(0)

sqlite3的简单使用

Android中也有sqlite3,主要是纪录一些基础的语法,ios提供封装的类,不需要下面这样操作 1,创建数据库 #pragma mark-打开数据库 -(BOOL)openDataBase{ //1,存放路径,存放在当前应用的沙盒中 document // NSArray *arrayPath=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); // // NSString *documentPath= [arrayPath objectAtIndex:0];//documen…

2016-03-21 21:02 · oc学习 · 评论(0)

HTTP请求和JSON解析与组装

json和xml在开发中回经常使用到,上次问同事ios设计到xml的请求是否存在,问答是快被淘汰了,xml在android的使用也很少 解析本地json文件 { "settingView":"showContent", "mainViewModelData": [ { "contenttitle": "地图", "contentPage": "", "state": "1" }, { "contenttitle": "语音搜索", "contentPage": "", "state": "1" }, { "contenttitle": "推送消息", "contentPage": "", "…

2016-03-20 18:07 · oc学习 · 评论(0)

代码设置inputType为numberDecimal无效的解决办法

InputType代码中设置为小数无效: 1,第一中解决办法 InputType.TYPE_NUMBER_FLAG_SIGNED代表符号位 mEditText.setInputType(InputType.TYPE_CLASS_NUMBER|InputType.TYPE_NUMBER_FLAG_DECIMAL|InputType.TYPE_NUMBER_FLAG_SIGNED); 2,第二种 public static DigitsKeyListener getInstance(boolean sign, boolean decimal) Returns a DigitsKeyListene…

2016-03-20 00:57 · Android 基础 · 评论(0)

NSFileHandler和沙盒模式

沙盒模式下的文件路径: -(void)getSystemFilePath{ //沙盒所在的根目录 NSString *homeDirectory = NSHomeDirectory(); NSLog(@"path:%@", homeDirectory); //应用程序路径 NSString*appPath = [[NSBundle mainBundle] resourcePath]; NSLog(@"path:%@", appPath); //document目录 NSArray *docPaths = NSSearchPathForDirectoriesInDomains(NSDocume…

2016-03-20 00:39 · oc学习 · 评论(0)

线程和定时器

一:多线程 1,NSThread创建线程 a,NSThread的类方法创建线程 [NSThread detachNewThreadSelector:@selector(doing) toTarget:self withObject:nil]; withObject 参数 下面几个方法类似 b,构造方法创建线程需要start NSThread *th=[[NSThread alloc]initWithTarget:self selector:@selector(doing) object:nil]; [th start]; c,View创建 [self performSelectorInBac…

2016-03-13 00:50 · oc学习 · 评论(0)

iOS回调

回调的简单使用,留一个笔记,方便以后查找 1,定义blocktypedefvoid(^signedRightJson)(); typedef void(^signedErrorJson)(); 2,定义的中复制 -(void)performActionWithCompletion:(signedRightJson)completion{ completion(); } 3,调用 BlockDemo *bd= [[BlockDemoalloc]init]; [bd performActionWithCompletion:^{ NSLog(@"%@",d.price); }]; 完整代码: ty…

2016-03-03 20:30 · iOS UI · 评论(0)

对话框和table的使用

1,UICVIewControl的生命周期 -(void)viewWillAppear:(BOOL)animated{ //将要显示 NSLog(@"viewWillAppear...."); } -(void)viewDidAppear:(BOOL)animated{ NSLog(@"viewDidAppear..."); 显示完成 } -(void)viewWillDisappear:(BOOL)animated{ NSLog(@"viewWillDisappear..."); 将要关闭 } -(void)viewDidDisappear:(BOOL)animated{ NSLog(@"…

2015-12-25 00:22 · iOS UI · 评论(0)

UIScrollView,UITableView的简单使用

UIScrollView的简单使用 1,创建对象 2,设置滑动区域 3,创建滑动的View 4,将滑动的view添加到ScrollView上显示 5,释放对象 CGRect screenBounds = [ [UIScreen mainScreen]bounds];//返回的是带有状态栏的Rect // CGRect rect = [ [UIScreen mainScreen]application Frame];//不包含状态栏的Rect //创建ScrollViewiew UIScrollView *scrollView=[[UIScrollView alloc]initWithFram…

2015-12-21 23:57 · iOS UI · 评论(0)

UIProgressView进度条,UISlider滑动条,UISegmentedControl分隔栏的简单使用

UISegmentedControl是开发中经常会使用到,所以刚刚在学习的时候也重点的看了下该控件 进度条和滑动条一半很少会使用到(下载的时候会经常使用到该属性),android的进度条和滑动的设置比ios复杂很多 先上图 1,进度条 /**进度条的使用 1.创建UIProGressView对象 2,创建定时器 3,将定时器的值与进度条的长度关联setProgress 4,释放对象 */ //进度条的使用UIProgressView progress=[[UIProgressView alloc]initWithFrame:CGRectMake(50, 250, 300, 150)]; pr…

2015-12-20 16:16 · iOS UI · 评论(0)

UILabel,UIButton,UITextField的简单使用

UILabel文本类似android的TextView,javaSwing里面的文本也叫Label 创建 个UILabel,遵循以下 个步骤来完成: 1、alloc开辟空间,然后initWithFrame来初始化 ; 2、设置UILabel 的相关属性,也就是我们想要的属性 3、把label添加到 视图(UIWindow)上,才可以显 出来; 4、释放label // Do any additional setup after loading the view, typically from a nib. UILabel *label= [[UILabel alloc]init]; labe…

2015-12-20 00:01 · iOS UI · 评论(0)

UIWindow和UIView的简单使用

UIWindow是是一个窗体,用来显示组件,相当于世一个容器 1,创建UIWindow //创建window self.window=[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen] bounds]]; //设置window的背景 self.window.backgroundColor=[UIColor whiteColor]; //设置window显示的view ViewController *vc=[[ViewController alloc]init]; //创建rootview UINavigationController *…

2015-12-19 16:10 · iOS UI · 评论(0)