自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(36)
  • 资源 (1)
  • 收藏
  • 关注

原创 NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)

遇到此问题的解决办法: 使用中的didReceiveChallenge方法,方法中的代码如下: - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAu

2016-01-14 10:11:16 2806

原创 storyboard 添加Navigation Controller

之前没想到要用Navigation Controller,开发了一会儿发现还是需要加上。后加Nav的方法如下: 1.拖一个 Navigation Controller到storeboard中。 2.把其自带的RootViewController删掉。 3.右键拖拽将NavigationController与自己的首页ViewController链接起来,并设置为rootViewCon

2015-08-28 10:04:31 3993

原创 Tomcat 下载与运行 (MAC)

1.进入官网进入相应版本下载界面 2.选择 tar.gz 压缩包下载 3.解压后进入 bin 目录,赋予.sh结尾文件执行权限,否则会报下图的错 添加权限: chmod +x *.sh 4.启动tomcat sudo sh startup.sh 当然,关闭tomcat自然是调用shutdown.sh

2015-07-21 01:24:16 581

原创 MongoDB安装、配置、启动(MAC)

1.前往官网下载MongoDB压缩包 2.将下载好的压缩包解压,将解压出的文件夹下的内容全部复制到新的路径下。 cp -r mongodb-osx-x86_64-3.0.4 /usr/local/mongodb 3. 在新建立的文件夹下建立data文件夹用来记录数据,log文件夹用来记录日志 cd /usr/local/mongodbmkdir datamkdir

2015-07-19 01:42:36 16084

原创 Cocos2d-x 各种诡异问题经验记录

根据网上的帖子导入工程后各种配置完成依旧报错? 那么需要注意两点: 1.Eclipse工作空间需要跟cocos2dx目录同级。 2.项目导入Eclipse的时候不要选择copy into workspace之类的,否则各种.h文件找不到。

2015-01-13 16:07:16 461

原创 Android Handler 使用

Handler 负责发送消息,Looper负责接收Handler发送的消息并直接把消息回传给Handler自己。 MessageQueue就是一个存储消息的容器。 在主线程(UI线程)创建Handler来处理子线程发起的UI更新操作。 创建Handler时构造函数传入的Callback类型的参数,可以起到message过滤的功能。 用法1: //主线程创建的Han

2015-01-11 23:06:36 401

原创 iOS TableView 使用(swift)

iOS tableview swift class ViewController: UIViewController ,UITableViewDelegate,UITableViewDataSource 2.要将

2015-01-07 01:26:31 592

原创 Tomcat启动后自动执行某方法

web.xml     com.PreloadListener java代码 public class PreloadListener implements ServletContextListener{   public void contextInitialized (ServeltContextEvent sce){      //init operation  

2014-09-24 17:14:38 1430

原创 ant 使用apkbuilder.bat打包APK 找不到路径问题

使用ant 编译android项目的时候使用到了apkbuil

2014-09-17 17:36:26 2124

原创 IOS UITableview

1. .h 文件要声明协议 UITableViewDataSource> 2.再.h文件中创建数据集合 @property (nonatomic,retain) NSArray *listArray;//tableView的数据集合 3..h中声明变量 @private     UITableView *_tableView; 4.实例化变

2013-10-23 14:52:58 743

原创 IOS UIImageView

UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(140, 330, 50, 50)];     imageView.userInteractionEnabled = YES;     //imageView.highlighted = YES;//flag设置标志以显示高亮图片  

2013-10-23 00:29:33 633

原创 IOS UIActionSheet

UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"title" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"destructive" otherButtonTitles:@"other", nil]; [sheet s

2013-10-23 00:07:10 713

原创 IOS UIAlertView

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"title" message:@"" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"other", nil]; [alertView show]; 用到代理方法时

2013-10-22 23:50:33 698

原创 IOS UISlider

UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(60, 200, 200, 0)];     slider.tag = 152;     slider.maximumValue = 10;     slider.minimumValue = 0;          //设置slider监听事

2013-10-22 23:26:58 878

原创 Android DOM 解析

package com.jerry.earthquake; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.text.SimpleDateFormat; import java.util.Ar

2013-10-21 10:45:23 787

原创 IOS UITextField

_helloField = [[UITextField alloc] initWithFrame:CGRectMake(70, 150, 140, 40)];     //样式,如果要用自定义图片背景的话要设成none     _helloField.borderStyle = UITextBorderStyleLine;     _helloField.placeho

2013-10-20 19:33:42 946

原创 IOS UIButton

//工厂方法创建button并设定样式     UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];     //设置成禁用     //button.enabled = NO;     //设置选中     //button.selected = YES;     

2013-10-20 18:38:57 818

原创 Android Fragment

1.创建Fragment类 package com.jerry.todolist; import android.app.Activity; import android.app.Fragment; import android.os.Bundle; import android.view.KeyEvent; import android.view.LayoutInflater; impo

2013-10-18 09:32:42 797

原创 IOS UILabel

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(90, 30, 140, 40)];     label.text = @"hello label abcdefghijklmn";     label.font = [UIFont systemFontOfSize:10];     //换行     l

2013-10-18 00:04:21 650

原创 IOS 通知

1.注册通知 //通知  向通知中心注册了一条名为ChangeTextNotification的通知。     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTextContent:) name:@"ChangeTextNotification" objec

2013-10-17 23:07:30 558

原创 IOS 设置代理

1.先在需要使用代理的类.h文件中声明协议并创建代理实例 //定义协议 @protocol ModalViewControllerDelegate NSObject> @optional - (void)changeTextContent:(NSString *)text; @end //创建代理实例 @property (no

2013-10-16 22:57:38 986

原创 IOS 模态视图跳转界面

跳转 - (IBAction)present:(id)sender {          NSLog(@"the button,is clicked ...");     //创建准备跳转的UIViewController     ModalViewController *modalViewController = [[ModalViewController alloc

2013-10-16 22:19:41 3220

原创 Android ImageView 手势控制放大缩小 滑屏切换

package com.dawnpro.dfacmobile.cpzs; import java.io.InputStream; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.util.Log; import

2013-10-16 15:32:30 2767

原创 Android image selector

按钮图片根据XML设置,在未点击跟点击后显示两张不同图片 1.定义selector的XML back_btn_selector.xml <item android:state_pressed="true" android:drawable="@drawable/back_btn_focus" //点击下去的时候要显示的图片

2013-10-11 15:42:50 819

原创 Android Handler Looper MessageQueue

1.UI线程中Handler 向 UI 线程Looper的MessageQueue发送消息,并接收消息处理 package com.jerry.test; import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.os.Handler; impor

2013-10-11 15:29:15 608

原创 Android 设置ImageView 宽高

1.在应用启动时获取屏幕宽高 DisplayMetrics metric = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metric); int width = metric.widthPixels; // 屏幕宽度(像素) int height = metric.hei

2013-10-10 17:19:24 2722

原创 Android 解决 图片内存溢出

1.使用BitmapFactory的decodeStream方法加载图片,此方法直接调用JNI底层C/C++方法,避免了JAVA层消耗: private void setImage(int page){ //images[page]为资源ID数组中的资源ID InputStream is = this.getResources().openRawResource(images[pag

2013-10-10 16:57:21 844

原创 Android GestureDetector 手势滑屏

屏幕左右滑屏事件 1.创建滑屏监听类,独立或者内部类都可: /** * 滑动监听类 * @author dpjiangyb * */ class MyGuestListner extends SimpleOnGestureListener{ //监听滑动事件 @Override public boolean onFling(MotionEvent e

2013-10-10 09:47:56 995

原创 IOS UIViewController

1.代码创建 //将视图控制器添加到window上 代码添加 UIViewController *mainViewController = [[UIViewController alloc] init]; mainViewController.view.backgroundColor = [UIColor redColor]; self.window.rootViewCont

2013-10-09 01:11:29 852

原创 Android SAX 解析

1.创建针对目标XML的Handler,解析操作类。 /** * SAX解析器handler * * @author dpjiangyb * */ private class NewsListContentHandler extends DefaultHandler { // tag name private String tagName = null;

2013-10-08 01:03:02 619

原创 JAVA 遍历 map

1.利用keyset进行遍历,根据key值获取value: public static void workByKeySet(Map map) {   Set key = map.keySet();   for (Iterator it = key.iterator(); it.hasNext();) { String s = (String) it.n

2013-10-07 10:51:43 601

原创 IOS UIView

//通过xib方式创建视图对象 NSBundle *bundle = [NSBundle mainBundle]; NSArray *arr = [bundle loadNibNamed:@"myView" owner:self options:nil]; UIView *myView = [arr objectAtIndex:0]; //代码创建 CGRec

2013-10-05 18:43:29 1078

原创 IOS 判断是否第一次进入 并使用navigationController跳转

1.在项目AppDelegate.m文件中didFinishLaunchingWithOptions方法下加入 //设置一个存储值,记录是否第一次进入     BOOL isFirst = [[NSUserDefaults standardUserDefaults] boolForKey:@"isFirst"];     //判断是否第一次进入     if (!isF

2013-10-05 02:49:00 1268

原创 IOS XML解析

xml文件中需要解析的数据节点单个样式 吉祥航空 HO1252 北京首都国际机场 上海虹桥国际机场 06:35 09:00 320 0 123456日 1. 在.h文件中加入协议 NSXMLParserDelegate

2013-10-05 02:26:52 636

原创 IOS网络请求 ASIHTTPRequest导入

1.类库下载地址ASIHTTPRequest库下载。 2.将其中的class文件下的文件全部拷贝到工程中自建的asihttprequest文件夹下。 3.导入框架:

2013-10-04 02:42:40 1083

原创 动态设置 UITextField

//设置位置大小 text3 = [[UITextField alloc] initWithFrame:CGRectMake(120,200, 150, 30)]; //设置外观 text3.borderStyle = UITextBorderStyleRoundedRect; //设置字体大小 text3.font = [UIFont systemFont

2013-10-02 01:30:02 664

android Looper demo

android 中利用 handler 1.主线程内消息发送。2.子线程向主线程发送消息。3.主线程向子线程发送消息

2013-10-15

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除