自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(72)
  • 收藏
  • 关注

原创 iphone中 iframe白屏问题

在 cordova 项目里的 config.xml里加上 <access origin="*" /> <allow-navigation href="*" /> <allow-intent href="*" />

2018-04-28 18:42:12 3471

原创 cordova declare styleable 错误

出现 ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute可以使用cordova plugin add cordova-plugin-file-opener2 cordova-android-support-gradle-release 命令安装支持现在版本的插件解决问题

2018-03-13 15:43:18 247

原创 隐藏 video标签的下载按钮

在 cordova-plugin-inappbrowser插件中隐藏 Android 的 webView里的 &lt;video&gt;标签: let webView = window.cordova.InAppBrowser.open(fileUrl, '_blank', 'location=yes,enableViewportScale=yes') if (window.dev...

2018-03-06 18:10:57 1772

原创 Cocos2d 与OC的互相调用

JS里面调用OCvar ret = jsb.reflection.callStaticMethod("NativeOcClass", "callNativeUIWithTitle:andContent:", "cocos2d-js", "Yes! you call a Native UI from Reflection");对应的Oc代码为: +(BOOL)callNativeUIWith

2016-11-17 18:01:50 1639

转载 TabbarItem没有文字,图片居中

// 矫正TabBar图片位置,使之垂直居中显示 CGFloat offset = 5.0; for (UITabBarItem *item in self.tabbar.items) { item.imageInsets = UIEdgeInsetsMake(offset, 0, -offset, 0); }

2016-11-02 14:14:14 1395

原创 IOS10.1真机调试

把ios10.1模拟器文件放到应用程序–显示包内容–Developer–Platforms–iPhoneOS.platform–DeviceSupport里下载:链接: https://pan.baidu.com/s/1bpoSSyV 密码: wura

2016-10-17 13:15:47 2801

转载 app名称多语言

创建strings文件,改名InfoPlist.strings. 在右侧的Localization里面选取多语言 每个语言strings里面”CFBundleDisplayName” = “对应app名称”;

2016-10-17 09:50:54 332

转载 navigationBar设置

原:http://www.jianshu.com/p/457c80cbb487

2016-10-11 15:09:13 236

转载 应用内切换语言

https://github.com/maximbilan/ios_language_manager

2016-09-18 17:04:43 287

原创 xcode7.3使用 ios10 真机调试

把ios10包放在: 应用程序–显示包内容–Developer–Platforms–iPhoneOS.platform–DeviceSupport里ios10包地址: http://pan.baidu.com/s/1kUQnKAr 49tn

2016-08-31 17:18:33 5761 2

原创 极光推送通知和消息

APNS不能在APP未运行时收到 需要同时发送自定义消息 需要在代码里判断什么时候执行通知还是消息

2016-08-29 10:02:32 780

转载 setneedsdispaly

setneedsdispaly并不是立即调用drawrect,而是添加一个标识,下次屏幕刷新时才会调用 屏幕刷新是每秒60次 所以用NSTimer添加setneedsdispaly方法时,如果方法调用过快会导致越来越卡,这时候使用CADisplayLink可以解决问题

2016-08-26 11:17:37 246

转载 xcode8 IOS10 远程推送问题:未找到应用程序的“aps-environment”的权利字符串

原地址:http://www.jianshu.com/p/62f631012853

2016-08-24 12:32:15 4779

转载 Xcode真机调试出现“ is busy: Processing symbol files”

原地址: http://www.cocoachina.com/bbs/read.php?tid=1678685有时升级完Xcode,真机调试的时候却出现“* is busy: Processing symbol files”网上虽然有以下解决方法: 1、尝试重新拔插测试设备。 2、如果“1”不起作用,重启Xcode尝试。 3、如果“2”不起作用,重启手机,然后尝试。(解决)。但是有时还是

2016-08-24 11:41:04 2617

转载 iOS开发之如何跳到系统设置里的各种设置界面

原地址: http://www.superqq.com/blog/2015/12/01/jump-setting-per-page/跳到更多设置界面除了跳到WiFi设置界面,能不能跳到其他的设置界面呢?比如:定位服务、FaceTime、音乐等等。都是可以的,一起来看看如何实现的!定位服务定位服务有很多APP都有,如果用户关闭了定位,那么,我们在APP里面可以提示用户打开定位服务。点击到设置界面设置,

2016-08-19 15:24:26 277

转载 textField详解

原地址:http://www.jianshu.com/p/fe95f7e64b89

2016-08-18 15:06:38 254

原创 placeholder颜色

[tf setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];

2016-08-18 15:00:23 222

原创 headerVIew不随tableView 滚动

可以在viewController上新建一个tableView,

2016-08-18 14:16:26 266

转载 在iOS7之后,苹果会自动给导航控制器里面的所有UIScrollView顶部都会添加额外的滚动区域64.

// 设置不需要添加额外的滚动区域 self.automaticallyAdjustsScrollViewInsets = YES;

2016-08-18 13:17:42 315

转载 Xcode插件: 控制台打印插件 KZLinkedConsole

原简书地址:http://www.jianshu.com/p/9c88380c24e6OC : #if DEBUG #ifndef DLog#define DLog(format, args...) \ NSLog(@"[%s:%d]: " format "\n", strrchr(__FILE__, '/') + 1, __LINE__, ## args); #endif #else

2016-08-17 10:35:08 437

原创 当两个viewController的背景色不同时,使用self.navigationController pushviewcontroller 出现bug 时

在第二个控制器里设置一下背景色就好了

2016-08-16 15:56:58 307

转载 宏定义输出

#ifdef DEBUG //调试阶段//...表示在宏里面的可变参数//__VA_ARGS__表示宏里面的可变参数#define VLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);#else //发布阶段#define SLog(...)#e

2016-08-15 11:23:29 583

转载 ios 截图.image的旋转问题

截图://截图- (UIImage*)captureView:(UIImageView*)theView{ CGRect rect = theView.frame; UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); [theVi

2016-08-12 17:03:22 319

转载 本地化处理

比如searchBar的取消按钮的cancel改为取消在 PROJECT->info ->Localizations 里添加Chinese(Simplified)就好了,它自己就变成了取消了。

2016-08-10 13:02:27 194

转载 tableView搜索功能

框架:https://github.com/honeycao/HCSortAndSearchDemo github里面有详细的说明 支持中文排序#import "ChineseToPinyin.h"#import "HCSortString.h"#import "WLCCityTVC.h"#import "WLCProvinceModel.h"#import "ZYPinYinSearc

2016-08-09 17:28:51 1263 3

原创 如果上传字典数组到服务器,服务器显示的格式不是字典数组

int index = 0; for (NSDictionary* dic in self.contactArrM) { for (NSString* key in [dic allKeys]) { params[[NSString stringWithFormat:@"related_contacts[%d][%@]", index, key]] =

2016-08-05 14:39:05 218

原创 调用完系统相机,状态栏消失

添加- (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [[UIApplication sharedApplication] setStatusBarHidden:NO];}

2016-08-04 18:10:17 195

原创 键盘大写与字符串大写

键盘:cell.textField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;字符串 textField.text = [textField.text uppercaseStringWithLocale:[NSLocale currentLocale]];

2016-08-03 18:32:01 516

原创 Please file a radar on UIKit if you see this assertion.

不知道具体原因 在使用MWPhotoBrowser框架时遇到过这个问题 MW在使用时会导致内存过大

2016-08-03 15:41:54 2301

转载 textField限定输入字数

原地址 : http://blog.sina.com.cn/s/blog_60f977e70101g4gj.html<1>在init时候注册notification:[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textFiledEditChanged:)

2016-08-03 15:40:43 869

原创 scrollView使用masonry

//使用 [self.view addSubview:scrollV];//不能用self.view = scrollV; [scrollV mas_makeConstraints:^(MASConstraintMaker* make) { make.edges.mas_equalTo(self.view); //contentSize 随着内容增多而增多

2016-07-26 13:30:08 211

转载 UIButton增加响应区域

原文地址:http://wenrisheng.iteye.com/blog/1987996给UIButton 建立一个Category:–UIButton+EnlargeEdge.h#import <objc/runtime.h>@interface UIButton (EnlargeEdge)- (void)setEnlargeEdge:(CGFloat) size;- (void)setEn

2016-07-25 16:32:13 286

原创 判断字典里是否有key

[[dict allKeys] containsObject:@"key"]

2016-07-21 19:04:17 655

原创 UIAlertController使用

UIAlertController* alertC = [UIAlertController alertControllerWithTitle:@"确认要离开吗?" message:@"离开的话已填的数据就没了哦" preferredStyle:UIAlertControllerStyleAlert]; //style分为中间弹出,还是底下弹出列表 UIAlertAction* cancel

2016-07-21 14:41:13 215

原创 重写navagationBar.backBarbuttonItem的返回方法

https://github.com/onegray/UIViewController-BackButtonHandler 把里面的文件拖入到项目中,重写-(BOOL)navigationShouldPopOnBackButton{ return YES;//YES是执行,NO是不执行}

2016-07-21 14:17:31 305

原创 awakeFromNib方法中的注意

里面的控件的宽高是根据你的xib文件大小的,不自适应屏幕

2016-07-21 11:01:21 518

转载 含有字典的数组排序

NSArray *sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"loan_days" ascending:YES]]; [self.infoArrM sortUsingDescriptors:sortDescriptors];

2016-07-20 15:00:21 309

转载 去除tabBar上方横线

-(void)hiddenTopLine { /// 隐藏底部 TabBar 的上横线 for (UIView *view in self.tabBarController.tabBar.subviews) { if ([view isKindOfClass:[UIImageView class]] && view.bounds

2016-07-20 14:16:57 358

原创 UIButton 图片文字左右互换

[self setTitleEdgeInsets:UIEdgeInsetsMake(0, -self.imageView.frame.size.width, 0, self.imageView.frame.size.width)]; [self setImageEdgeInsets:UIEdgeInsetsMake(0, self.titleLabel.bounds.size.width,

2016-07-20 14:00:38 920

原创 出现<object returned empty description>的解决方法

使用 [str length] <= 0判断处理

2016-07-19 18:10:42 9822

空空如也

空空如也

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

TA关注的人

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