自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 如何让主界面NavigationBar隐藏,而push到的下一个界面显示NavigationBar?

- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:YES animated:animated]; } - (void)viewWillDisappear:(BOOL)animated

2016-02-16 10:19:33 681

转载 iOS storyboard tableview 内容下移64 解决

转载自:http://www.it165.net/pro/html/201405/13171.html 之前碰到过一个问题。 就是利用storyboard拖动出来的控件, 在iOS7上跑老是莫名的下移。 比如这样(红色区域为多余的) 解决办法: iOS7在Conttoller中新增了这个属性: automaticallyAdjustsS

2015-08-14 11:55:54 2129

转载 怎么像safari一样滑动的时候隐藏navigationbar?

navigationController.hidesBarsOnSwipe = Yes

2015-07-03 11:08:49 451

转载 iOS系统声音提示

来源链接:http://www.cnblogs.com/qingjoin/archive/2012/09/29/2708384.html //在 工程下的target - Build Phases --Link Binary With Libraries --添加AudioToolbox.framework //然后在头文件中声明 #import //声音提示 #define SOUND

2015-07-03 10:54:11 645

原创 隐藏StatusBar

在info.plist文件中添加如下两行: Status bar is initially hidden 为YES iew controller-based status bar appearance  为NO

2015-06-29 14:02:42 610

原创 让代码中的属性可以在storyboard的右边栏中进行设置

#import #ifndef IBInspectable #define IBInspectable #endif @interface ToolBarVoiceView : UIView @property (nonatomic,strong) IBInspectable UIColor backgroundColor; @end

2015-06-25 17:25:40 324

原创 解决tableView上cell的按钮点击效果不明显(轻点无效)

在ios8中,可以让tableview继承一个baseTabelView父类,在父类的.,m文件中重写以下方法: #import "BaseTableView.h" @implementation BaseTableView - (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder];

2015-06-24 15:12:14 1102

原创 解决ScrollView显示内容与手动设置不符合情况

//添加这一句就好self.automaticallyAdjustsScrollViewInsets = NO;//A Boolean value that indicates whether the view controller should automatically adjust its scroll view insets.

2015-05-18 10:56:35 326

转载 限定textfield输入中文字数

原地址:http://blog.sina.com.cn/s/blog_60f977e70101g4gj.html -(void)dealloc { [[NSNotificationCenter defaultCenter]removeObserver:self name:@"UIText

2015-05-14 16:49:49 317

原创 解决ScrollView设置delaysContentTouches为NO后,按在button上scrollview无法滑动问题

在ScrollView中如果添加了button,一开始会出现button的按下效果不明显,此时会设置scrollView.delaysContentTouches = NO;来关闭延迟响应, 但是又会出现手指放在button上去做滑动,但是scrollView只会响应button的点击事件,而不去进行滑动. 要解决这个办法,需要重载UIScrollView这个类,并实现其中的touchesSho

2015-05-13 17:29:24 3569

原创 navigationBar 透明

naviEmptyBG为透明图(xcode6.3 ios8.3 oc语言) -(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.navigationController.navigationBar.shadowImage = [UIImage imageName

2015-05-08 16:33:52 367

转载 解决当最下层为ScrollView时,ScrollView上层View上的button点击动画延迟问题

解决办法来自网络,无法获知原作者. 以tableview的Cell为例: IOS6的UITableViewCell 子视图(subviews)的容器是UITableViewCellContentView IOS7的UITableViewCell 子视图(subviews)的容器是UITableViewCellScrollView 由于IOS7中添加了滑动后出现编辑按钮的操作,所以使用sc

2015-04-20 18:00:58 563

原创 UITextField实时打印输入的文字

需要设置UITextFieldDelegate,并且实现如下方法: -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSMutableString *str = [NSMutableSt

2015-04-20 13:27:32 499

原创 视频播放时强制横屏

//屏幕旋转 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } //进行自动旋转 -(BOOL)shouldAutoro

2015-03-19 11:31:48 1847

转载 彻底理解position与anchorPoint

转载自:http://wonderffee.github.io/blog/2013/10/13/understand-anchorpoint-and-position/ 引言 相信初接触到CALayer的人都会遇到以下几个问题:  为什么修改anchorPoint会移动layer的位置? CALayer的position点是哪一点呢? anchorPoint与position有什

2015-03-18 18:07:40 349

转载 iOS 删除文件夹下所有文件

源:http://www.cnblogs.com/easonoutlook/archive/2012/09/09/2677893.html 有时候需要在iOS系统里面,删除指定文件夹的内容,文件夹里面可能是文件,也可能包含有文件夹。 删除指定类型的文件。方法如下: NSString *extension = @"m4r"; NSFileM

2015-01-23 17:48:15 1361

转载 iOS中respondsToSelector与conformsToProtocol的相关理解和使用

源链接:http://www.lvtao.net/ios/514.html respondsToSelector相关的方法 : -(BOOL) isKindOfClass: classObj 用来判断是否是某个类或其子类的实例 -(BOOL) isMemberOfClass: classObj 用来判断是否是某个类的实例 -(BOOL) respondsToSelector

2015-01-22 17:29:45 513

原创 判断代理方法是否被实现

if([self.delegate respondsToSelector:@selector(test:)]){ ... }

2015-01-18 17:20:16 669

转载 如何在Xcode6中添加空模板

在Xcode中模板位置: Macintosh HD ▸ 应用程序 ▸ Xcode(低于版本6的).app ▸ Contents ▸ Developer ▸ Platforms ▸ iPhoneOS.platform ▸ Developer ▸ Library ▸ Xcode ▸ Templates ▸ Project Templates ▸ Application ▸ Empty App

2015-01-18 17:14:45 465

转载 获取目录下内容大小

通过以下两个方法获取文件夹大小: //获取文件大小 - (long long) fileSizeAtPath:(NSString*) filePath{ NSFileManager* manager = [NSFileManager defaultManager]; if ([manager fileExistsAtPath:filePath]){ ret

2015-01-14 17:41:46 352

原创 coreData 实体使用setValueWithDictionary赋值避免存在未定义字段而崩溃

-(id)valueForUndefinedKey:(NSString *)key { return nil; } -(void)setValue:(id)value forUndefinedKey:(NSString *)key { } 在.m文件中同时加上以上两个方法即可~

2015-01-13 20:46:21 701

翻译 Core Data - How to Do a SELECT DISTINCT

NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"People" inManagedObjectContext:managedObjectContext]; request.entity = entit

2015-01-12 16:02:12 587

原创 使用sdWebImage实现对tableView的cell加载图片淡入淡出效果

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CommonTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"article_Cell" fo

2015-01-06 15:36:06 4134

转载 iOS开发的一些奇巧淫技

源链接:  http://www.cocoachina.com/ios/20141231/10783.html TableView不显示没内容的Cell怎么办? 类似这种,我不想让下面那些空的显示. 很简单. 1 self.tableView.tableFooterView = [[UIView alloc] init];

2015-01-03 19:19:19 601

转载 coredata 最简单例子

原文:  http://zheyiw.iteye.com/blog/1672184 先按照网上的教程,建一个简单的带coredata的项目 再 添加一个 UserInfo 对象(表)(按照网上的教材,可视化方式添加) 然后在AppDelegate.m中按如下修改,(只添加了4个方法) 然后运行,看控制台日志 - (BOOL)application:(U

2015-01-03 17:51:46 352

转载 iOS学习之UIActionSheet的使用

http://blog.csdn.net/totogo2010/article/details/7618891

2014-12-26 09:27:41 259

转载 iOS开发拓展篇—应用之间的跳转和数据传

源链接:http://www.cnblogs.com/wendingding/p/3972034.html 说明:本文介绍app如何打开另一个app,并且传递数据。 一、简单说明 新建两个应用,分别为应用A和应用B. 实现要求:在appA的页面中点击对应的按钮,能够打开appB这个应用。 1.新建两个应用,分别为A和B.     2.设置应用B的url。

2014-12-23 17:03:01 337

空空如也

空空如也

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

TA关注的人

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