摘要: 在做动画时,uiview的旋转方向可以这样控制 若想顺时针,则x为正数,如30;若想逆时针,则x为负数即可,如-30还有旋转的原点,即以哪个点为圆心来旋转。这个点的选择与平常的坐标系不同,需要用到layer。如以imageView的左下角为圆心转,则有 如若让imageView以左下角按逆时针转动, 阅读全文
posted @ 2016-03-17 10:21 lixin327 阅读(1197) 评论(0) 推荐(0) 编辑
摘要: 当使用AVAudioRecorder录音后,再使用avplayer播放声音有时会出现声音变小,按音量调节键也不管用。在网上查的可以按以下方法解决录音的时候 [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayA 阅读全文
posted @ 2016-02-29 14:57 lixin327 阅读(1223) 评论(0) 推荐(0) 编辑
摘要: 效果是这样,在一个文本框内,限制字符最大长度为9,当超过这个长度时,即使能输入,也会被截取 _textField = [[UITextField alloc] initWithFrame:CGRectMake(14, 3, kScreenWidth-18, 34)]; _textField.plac 阅读全文
posted @ 2016-02-29 14:52 lixin327 阅读(543) 评论(0) 推荐(0) 编辑
摘要: 1.若项目能编译成功,但有错误提示时,可以用清理缓存的方式解决。 就是把/Users/用户名/Library/Developer/Xcode/DerivedData文件全部删除。但要注意的是删除前要关闭项目,否则该问题仍存在。 2.利用NSData读取文件 NSData读取文件时分两种形式,通过网络 阅读全文
posted @ 2016-02-29 14:46 lixin327 阅读(549) 评论(0) 推荐(0) 编辑
摘要: 一般以.xcuserdatad、.xcscmblueprint结尾的文件需要忽略,文件夹xcuserdata也需要,这些可以在Cornerstone——>Preference——>Subversion——>Global ignores中添加,去掉“use default global ignores... 阅读全文
posted @ 2015-12-04 17:09 lixin327 阅读(17885) 评论(0) 推荐(0) 编辑
摘要: 使用ALAsset获取图片的缩略图,一般都有模糊的问题[_imageView setImage:[UIImage imageWithCGImage:asset.thumbnail]];对于这种问题,比较简单的修改方法是使用[_imageView setImage:[UIImage imageWith... 阅读全文
posted @ 2015-12-04 17:06 lixin327 阅读(1584) 评论(0) 推荐(0) 编辑
摘要: 在Appdelegate中这样设置后ViewController *vc = [[ViewController alloc]init];UINavigationController *nav = [[UINavigationController alloc]initWithRootViewContr... 阅读全文
posted @ 2015-11-26 16:11 lixin327 阅读(702) 评论(0) 推荐(0) 编辑
摘要: 原图,为正方形就是给图片的cornerRadius设置为图片宽度的一半#define imgViewW 150UIImageView *imgView = [[UIImageView alloc]initWithFrame:CGRectMake(50, 100, imgViewW, imgVi... 阅读全文
posted @ 2015-11-23 17:58 lixin327 阅读(467) 评论(0) 推荐(0) 编辑
摘要: 1.一个gesture只能对应一个view。这是最根本的//若这样写,那么只有self.view能添加手势,self.navigationController.navigationBar是添加不上的,因为被覆盖了UITapGestureRecognizer *gesture = [[UITapGes... 阅读全文
posted @ 2015-11-23 17:55 lixin327 阅读(566) 评论(0) 推荐(0) 编辑
摘要: 返回按钮部分默认是蓝色,如有两个controller,A和B,其中A跳往B。在A中有 那么有两种方式可以修改①可以在B中(不是A)的viewDidLoad或viewWillAppear写 这样只修改B界面的颜色 ②在A中的viewWillAppear或viewDidLoad写 这种写法是全局的,会将 阅读全文
posted @ 2015-11-23 17:42 lixin327 阅读(973) 评论(0) 推荐(0) 编辑