自定义博客皮肤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)
  • 收藏
  • 关注

原创 iOS 8新特性—— UIAlertController

//// ViewController.m#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup

2015-11-28 19:37:57 391

原创 php artisan migrate时,[PDOException] SQLSTATE[HY000] [2002] No su

在运行迁移,执行 php artisan migrate命令后:报错提示:[PDOException] SQLSTATE[HY000] [2002] No such file or directory解决方法可能是:.env文件或者database.php文件DB_HOST改为:127.0.0.1'my

2015-11-24 10:56:37 2379

原创 观察者模式

1.用js实现观察者模式 div{width: 100px;height: 100px;border: 1px #999 solid;margin-bottom: 5px;} <!-- 我们让div对象观察select的变化,selecte变化就会通知这个2个对象,并引起这2个对象的变化,实现观察者模式。 --> 用观察者模式切换页面风格 男式风格 女

2015-11-23 21:18:05 345

原创 单例模式(防继承,防克隆)

<?php//单列模式// //1.普通类// class singleton{// }// $s1 = new singleton();// $s2 = new singleton();// //注意,2个变量是同1个对象的时候才全等// if ($s1 === $s2) {// echo '是一个对象';// }else{// echo '不是一个

2015-11-22 20:19:10 1756

原创 本地通知

1.添加通知 // 1.创建通知 UILocalNotification *localNote = [[UILocalNotification alloc] init]; // 2.设置属性 localNote.alertAction = @"开始玩游戏"; // 操作标题 localNote.alertBody = @"都好几天了, 你赶紧用一下我吧

2015-11-22 16:26:17 372

原创 录音的基本使用

//// ViewController.m#import "ViewController.h"#import @interface ViewController ()- (IBAction)startRecord;- (IBAction)stopRecord;/** * 录音器 */@property (nonatomic, strong) AVAudioRecor

2015-11-21 14:48:42 419

原创 magento接口调用常见错误

1.没有安装soap扩展2.没有安装xml扩展yum install php-soapyum install php-xml然后重启service httpd restart

2015-11-20 15:14:07 621 2

原创 音乐播放器-小案列

1.封装音频播放工具类//// AudioTool.h#import #import @interface AudioTool : NSObject/** * 播放音效 * * @param filename 音效文件名 */+ (void)playSound:(NSString *)filename;/** * 销毁音效 * * @param

2015-11-20 09:28:47 911

原创 音乐播放器类程序后台运行

1.AppDelegate.m- (void)applicationDidEnterBackground:(UIApplication *)application{ //开启后台任务,让程序保持运行状态 [application beginBackgroundTaskWithExpirationHandler:nil];}2.info.plistKEY: Requi

2015-11-19 20:56:50 1108

原创 用UICollectionView实现无限轮播案列

1.自定义View//// BannerView.h#import @interface BannerView : UIView/** * 实例化bannerView视图 */+ (instancetype)bannerView;/** * 用来接收控制器传递的数据 */@property(nonatomic,strong) NSArray *banners

2015-11-19 13:33:28 2117

原创 the behavior of the UICollectionViewFlowLayout is not defined because:

the behavior of the UICollectionViewFlowLayout is not defined because: the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minu

2015-11-19 11:54:27 4129

原创 再用UICollectionView做无限轮播的时候,布局错乱出现黑边,很可能是

很可能是布局问在控制器- (void)viewDidLoad { [super viewDidLoad]; self.automaticallyAdjustsScrollViewInsets = NO;}

2015-11-19 11:50:41 868

原创 音效播放工具类的简单封装

//// AudioTool.h// 工具类#import @interface AudioTool : NSObject/** * 播放音效 * * @param filename 音效文件名 */+ (void)playSound:(NSString *)filename;/** * 销毁音效 * * @param filename 音效文件名

2015-11-18 21:09:05 533

原创 音频播放初步认识

//// ViewController.m#import "ViewController.h"#import @interface ViewController ()@property(nonatomic,assign) SystemSoundID soundID;@end@implementation ViewController- (SystemSoundID)so

2015-11-18 20:40:52 493

转载 iOS8 自定义UITabBar (使用popToViewController导致的UITabBarButton重叠的问题)

最近工作中遇到自己定义的tabbar在iOS8 中重叠的情况.就是原本已经移除的UITabBarButton再次出现。折腾了半天,都不知道原因所在。最后翻阅文档。 说在iOS8 是允许动态添加tabbaritem的。所以,我猜想会不会是因为这个原因。那为什么iOS7又是没有问题的呢?回到正题。既然是动态添加。那么按照apple的一贯作风。一定会调用viewWillAutol

2015-11-13 20:38:07 1954 3

原创 添加程序进入后台,进入前台的通知

//页面将要进入前台,开启定时器-(void)viewWillAppear:(BOOL)animated{ //注册程序进入前台通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (startTimer) name: UIApplicationWillEnterFor

2015-11-13 14:32:56 5483

原创 magento 后台分类页面catelog,点击后,出现右边信息不同步显示,不显示点击的分类的信息,问题的解决!!!

通过逐个文件判断的方法,最后锁定了,一个模板,做了个备份,名字叫“blank 备份”,中文被系统读入成了乱码,至于为什么分类为什么不好用,没去深究,吧中文文字去掉,OK,好了。。。。 莫用中文,模板名字!!

2015-11-12 10:01:38 458

转载 回到顶部按钮

通过使用 jQuery 中的 animate 和 scrollTop 方法,你无需插件便可创建一个简单地回到顶部动画:// Back to top$('a.top').click(function (e) { e.preventDefault(); $(document.body).animate({scrollTop: 0}, 800);});Back to top

2015-11-11 15:50:27 601

转载 滚动时动态加载页面内容

有些网站的网页内容不是一次性加载完毕的,而是在鼠标向下滚动时动态加载的,这是怎么做到的呢?看下面代码:var loading = false;$(window).scroll(function(){ if((($(window).scrollTop()+$(window).height())+250)>=$(document).height()){ if(loading == fa

2015-11-11 15:47:52 3111

转载 测试密码的强度

//下面的正则表达式建议各位收藏哦,项目上有可能会用得着$('#pass').keyup(function(e) { //密码为八位及以上并且字母数字特殊字符三项都包括 var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); //密码为七

2015-11-11 15:45:43 860

转载 配置JQuery与其它库的兼容性

//方法一: 为JQuery重新命名为 $jvar $j = jQuery.noConflict();$j('#id')....//方法二: 推荐使用的方式(function($){ $(document).ready(function(){ //这儿,你可以正常的使用JQuery语法 });})(jQuery);

2015-11-11 15:42:41 440

转载 管理搜索框的值

现在各大网站都有搜索框,而搜索框通常都有默认值,当输入框获取焦点时,默认值消失。而一旦输入框失去焦点,而输入框里又没有输入新的值,输入框里的值又会恢复成默认值,如果往输入框里输入了新值,则输入框的值为新输入的值。这种特效用 JQuery 很容易实现:$("#searchbox") .focus(function(){$(this).val('')}) .blur(function(){

2015-11-11 15:41:09 693

转载 访问IFrame里的元素

在大多数情况下, IFrame 并不是好的解决方案,但由于各种原因,项目中确实用到了 IFrame ,所以你需要知道怎么去访问 IFrame 里的元素var iFrameDOM = $("iframe#someID").contents();//然后,就可以通过find方法来遍历获取iFrame中的元素了iFrameDOM.find(".message").slideUp();

2015-11-11 15:39:30 703

转载 导航菜单背景切换效果

在项目的前端页面里,相对于其它的导航菜单,激活的导航菜单需要设置不同的背景。这种效果实现的方式有很多种,下面是使用 JQuery 实现的一种方式: 导航一 导航二 导航三//注意:代码需要修饰完善$('#nav').click(function(e) { // 要知道siblings的使用$(e.target).addClass('tclass').sibli

2015-11-11 15:38:10 1268

原创 当一个view被添加到父控件中,就会调用

/** * 当一个view被添加到父控件中,就会调用 */- (void)didMoveToSuperview{// self.alpha = 0;// // [UIView animateWithDuration:2 animations:^{// self.alpha = 1;// }]; CAKeyframeAnimation

2015-11-10 20:56:16 1160

原创 UIAlertView弹出框的简单使用

- (void)createNavBtn{ UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] init]; leftItem.title = @"返回"; [leftItem setTarget:self]; [leftItem setAction:@selector(clickedLeftItem)];

2015-11-09 19:28:10 406

原创 PHP开发中,打开错误信息提示

在开发的时候,我们有时候需要打开错误信息。这时候,可以在php文件里设置:1.    ini_set("display_errors","On");2.    error_reporting(E_ALL);error_reporting(“E_ALL”)和ini_set(“display_errors”, “on”)的区别?后者的权限大于前者,后者是OFF的话,

2015-11-09 17:05:26 466

转载 CentOS yum安装mcrypt详细图解教程

在Linux的发行版CentOS 6.3 系统下,LAMP(Linux+Apache+Mysql+php)环境搭建好后发现PHPMyadmin提示 “无法载入mcrypt模块” 的错误感觉很不爽,就尝试着使用yum安装提示找不到模块。如下为执行过程:[root@ptr228 ~]# yum install php-mcryptSetting up Install ProcessNo p

2015-11-09 17:02:07 359

原创 MapKit自定义大头阵(iOS9下没有成功)

//// Annotation.h// 自定义大头针模型#import #import @interface Annotation : NSObject@property(nonatomic,assign)CLLocationCoordinate2D coordinate;@property(nonatomic,copy)NSString *title;@property(n

2015-11-08 20:36:21 348

原创 MapKit大头针的基本使用

//// ViewController.m#import "ViewController.h"#import #import #import "Annotation.h"@interface ViewController ()/** * 位置管理者对象 */@property(nonatomic,strong) CLLocationManager *locMgr;

2015-11-08 18:30:27 556

原创 MapKit的基本使用

//// ViewController.m#import "ViewController.h"#import #import @interface ViewController ()@property (weak, nonatomic) IBOutlet MKMapView *mapView;/** * 位置管理者对象 */@property(nonatomic,s

2015-11-08 17:47:24 335

原创 地理编码和反地理编码

//// ViewController.m#import "ViewController.h"#import @interface ViewController ()@property(nonatomic,strong)CLGeocoder *geocoder;#pragma mark - 地理编码- (IBAction)geocode:(UIButton *)sende

2015-11-08 14:59:59 534

原创 CoreLocation的基本使用

//// ViewController.m#import "ViewController.h"#import @interface ViewController ()@property(nonatomic,strong)CLLocationManager *locMgr;@end@implementation ViewController/** * 延迟创建定位管

2015-11-08 12:14:49 341

原创 Lable 富文本代码

//4.设置Label上的文字 AnswerModel *model = [self getFitModel:tableView]; NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@

2015-11-04 10:36:31 575

转载 查看CentOS版本方法

查看CentOS版本方法  有以下命令可以查看:# lsb_release -aLSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarchDistributor ID: CentOSDescription:    CentOS release 5.4 (

2015-11-02 12:49:48 427

原创 九宫格计算按钮frame的代码

//总列数 int totalColumns = 3; //应用的尺寸 CGFloat appW = 85; CGFloat appH = 90; //间隙 = (屏幕的宽度 - 3*应用的宽) / 4 CGFloat marginX = (self.view.frame.size.width - totalColumns*app

2015-11-02 10:34:24 768

空空如也

空空如也

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

TA关注的人

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