1:心跳效果,并可去除心跳

- (void)initScaleLayer
{
self.view.backgroundColor=[UIColor blueColor];
UIButton *myTelButtom=[[UIButton alloc]initWithFrame: CGRectMake(, , , )];
UIImage *btnTelImage=[UIImage imageNamed:@"customer_tel_icon"];
[myTelButtom setBackgroundImage:btnTelImage forState:UIControlStateNormal];
[myTelButtom setBackgroundImage:[UIImage imageNamed:@"customer_tel_icon"] forState:UIControlStateHighlighted];
[myTelButtom addTarget:self action:@selector(btnSave:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:myTelButtom]; //设定剧本
CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
scaleAnimation.fromValue = [NSNumber numberWithFloat:1.0];
scaleAnimation.toValue = [NSNumber numberWithFloat:1.2];
scaleAnimation.autoreverses = YES;
scaleAnimation.fillMode = kCAFillModeForwards;
scaleAnimation.repeatCount = MAXFLOAT;
scaleAnimation.duration = 0.8; //开演
[myTelButtom.layer addAnimation:scaleAnimation forKey:@"scaleAnimation"];
} -(void)btnSave:(id)sender
{
UIButton *btn=(UIButton *)sender;
[btn.layer removeAnimationForKey:@"scaleAnimation"]; }

 

2:启动动画效果实现

原理:启动页同样是放一张静态图,只是在启动时再创建一个图片视图把一张跟启动页的图片做动画;如下:

@interface AppDelegate ()

@property (strong,nonatomic) UIImageView *niceView;

@end

@implementation AppDelegate

@synthesize niceView;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    self.window.rootViewController = [[ViewController alloc]init];;
[self.window makeKeyAndVisible]; //圖片擴大淡出的效果开始; //设置一个图片;
niceView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
niceView.tag=;
niceView.image = [UIImage imageNamed:@"launch4.7.png"]; //添加到场景
[self.window addSubview:niceView]; //放到最顶层;
[self.window bringSubviewToFront:niceView]; CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"];
niceView.layer.anchorPoint = CGPointMake(.,.);
animation.fromValue = @1.0f;
animation.toValue = @1.3f;
animation.fillMode=kCAFillModeForwards; animation.removedOnCompletion = NO; [animation setAutoreverses:NO]; //动画时间
animation.duration=0.9;
animation.delegate=self; [niceView.layer addAnimation:animation forKey:@"scale"]; //结束; return YES; } -(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
[niceView removeFromSuperview]; }

 

3:计算标签的宽度并计算是否换行显示

-(void)creatUI:(NSMutableArray *)tagArr{

    self.tagArr = [NSMutableArray arrayWithArray:[tagArr mutableCopy]];

    if (self.is_can_addTag) {//如果可以添加标签,那么数组就多一个添加标签按钮
[self.tagArr addObject:self.addTagStr.length>?self.addTagStr:@"添加标签"];
}
tagView_height = ; self.backgroundColor = self.tagViewBackgroundColor?self.tagViewBackgroundColor:[UIColor whiteColor]; previousFrame = CGRectZero; [self.tagArr enumerateObjectsUsingBlock:^(id value, NSUInteger idx, BOOL *stop) { //Tag标题(看传入的是字典还是字符串)
NSMutableString *titleStr = [NSMutableString stringWithString:self.tagStateType==?@" ":@""];
if ([value isKindOfClass:[NSString class]]) {
[titleStr appendString:value];
}else if([value isKindOfClass:[NSDictionary class]]){
if (!self.tagArrkey) {
//获取不到Value,因为没传入Key
NSLog(@"获取不到Value,因为没传入Key");
return ;
}
[titleStr appendString:[value valueForKey:self.tagArrkey]];
} //创建Label
UILabel*tagLabel = [[UILabel alloc]initWithFrame:CGRectZero];
[self creatTagUI:tagLabel];
tagLabel.text = titleStr;
tagLabel.tag = KTapLabelTag+idx; //计算label的大小
NSDictionary *attrs = @{NSFontAttributeName : [UIFont systemFontOfSize:self.tagFont?self.tagFont:KTagFont]};
CGSize Size_str = [titleStr sizeWithAttributes:attrs];
Size_str.width += K_Tag_Title_H_Marin*;
Size_str.height += K_Tag_Title_V_Marin*; CGRect newRect = CGRectZero; if (previousFrame.origin.x + previousFrame.size.width + Size_str.width + K_Tag_Right_Margin > JF_Screen_Width) { newRect.origin = CGPointMake(, previousFrame.origin.y + Size_str.height + K_Tag_Bottom_Margin);
tagView_height += Size_str.height + K_Tag_Bottom_Margin;
}
else {
newRect.origin = CGPointMake(previousFrame.origin.x + previousFrame.size.width + K_Tag_Right_Margin, previousFrame.origin.y); }
newRect.size = Size_str;
[tagLabel setFrame:newRect];
previousFrame=tagLabel.frame; //改变控件高度
if (idx==self.tagArr.count-) {
[self setHight:self andHight:tagView_height+Size_str.height + K_Tag_Bottom_Margin];
}
[self addSubview:tagLabel]; //新增删除、添加功能
if (self.is_can_addTag&&idx==self.tagArr.count-) {//能添加状态&&最后一个-->(进入添加tag界面不用显示删除图片) }else{
if (self.tagStateType==) {
//移除的图片
UIImageView *removeImage = [[UIImageView alloc] initWithFrame:CGRectMake(tagLabel.jf_right-Image_Width*1.5, tagLabel.jf_top+(tagLabel.jf_height-Image_Height)/, Image_Width, Image_Height)];
//删除图片可以换成自己的图片
removeImage.image = [UIImage imageNamed:@"btn_removeTag"];
[self addSubview:removeImage];
}
} //点击按钮
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(tagLabel.frame.origin.x, tagLabel.frame.origin.y, tagLabel.frame.size.width, tagLabel.frame.size.height)];
[button setTag:KButtonTag+idx];
[button addTarget:self action:@selector(clickTag:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:button]; }];
}

 

4:Fabric增加脚本KEY的操作内容

把相应的DSYM文件也上传到官网;

5:通过xcrun atos查看dsym报错的详细地址(每次打包时要把当前对应的.DSYM文件保存下来,为后期定位错误做准备)

进入到DSYM文件的文件地方,

使用xcrun atos命令

atos -o YourApp.app.dSYM/Contents/Resources/DWARF/YourApp 0x00062867

实例:

从友盟或者其它地方可以获得报错的编码,通过上面的命令就可以查看到错误地址;

IOS开发基础知识--碎片29的更多相关文章

  1. IOS开发基础知识碎片-导航

    1:IOS开发基础知识--碎片1 a:NSString与NSInteger的互换 b:Objective-c中集合里面不能存放基础类型,比如int string float等,只能把它们转化成对象才可 ...

  2. IOS开发基础知识--碎片19

    1:键盘事件顺序 UIKeyboardWillShowNotification // 键盘显示之前 UIKeyboardDidShowNotification // 键盘显示完成后 UIKeyboar ...

  3. IOS开发基础知识--碎片33

    1:AFNetworking状态栏网络请求效果 直接在AppDelegate里面didFinishLaunchingWithOptions进行设置 [[AFNetworkActivityIndicat ...

  4. IOS开发基础知识--碎片42

    1:报thread 1:exc_bad_access(code=1,address=0x70********) 闪退 这种错误通常是内存管理的问题,一般是访问了已经释放的对象导致的,可以开启僵尸对象( ...

  5. IOS开发基础知识--碎片50

      1:Masonry 2个或2个以上的控件等间隔排序 /** * 多个控件固定间隔的等间隔排列,变化的是控件的长度或者宽度值 * * @param axisType 轴线方向 * @param fi ...

  6. IOS开发基础知识--碎片3

    十二:判断设备 //设备名称 return [UIDevice currentDevice].name; //设备型号,只可得到是何设备,无法得到是第几代设备 return [UIDevice cur ...

  7. IOS开发基础知识--碎片11

    1:AFNetwork判断网络状态 #import “AFNetworkActivityIndicatorManager.h" - (BOOL)application:(UIApplicat ...

  8. IOS开发基础知识--碎片14

    1:ZIP文件压缩跟解压,使用ZipArchive 创建/添加一个zip包 ZipArchive* zipFile = [[ZipArchive alloc] init]; //次数得zipfilen ...

  9. IOS开发基础知识--碎片16

    1:Objective-C语法之动态类型(isKindOfClass, isMemberOfClass,id) 对象在运行时获取其类型的能力称为内省.内省可以有多种方法实现. 判断对象类型 -(BOO ...

随机推荐

  1. Android Drawable、Bitmap、byte[]之间的转换

    转自http://blog.csdn.net/june5253/article/details/7826597 1.Bitmap-->Drawable Bitmap drawable2Bitma ...

  2. 一起学微软Power BI系列-官方文档-入门指南(4)Power BI的可视化

    在前面的系列文章中,我们介绍了官方有关获取数据,以及建模的原始文档和基本介绍.今天继续给大家介绍官方文档中,有关可视化的内容.实际上获获取数据和建模更注重业务关系的处理,而可视化则关注对数据的解读.这 ...

  3. Android使用TextureView播放视频

    1.引言 如果你想显示一段在线视频或者任意的数据流比如视频或者OpenGL 场景,你可以用android中的TextureView做到. 1).TextureView的兄弟SurfaceView 应用 ...

  4. Oracle_SQL函数-分组函数

    分组函数 什么是分组函数 分组函数作用于一组数据,并对一组数据返回一个值 组函数类型:主要有6种 AVG - 平均 COUNT - 计数 MAX - 最大 MIN - 最小 SUM - 求和 STDD ...

  5. 基于DDD + SD.Framework实现的统一身份认证系统

    项目地址 http://git.oschina.net/lishilei0523/ShSoft.UAC 项目说明 本项目开发的目的有三: 1.作为一个使用SD.Framework框架开发的项目样板 2 ...

  6. 使用MAT(Memory Analyzer Tool)工具分析dump文件--转

    原文地址:http://gao-xianglong.iteye.com/blog/2173140?utm_source=tuicool&utm_medium=referral 前言 生产环境中 ...

  7. iOS开发——高级特性&Runtime运行时特性详解

    Runtime运行时特性详解 本文详细整理了 Cocoa 的 Runtime 系统的知识,它使得 Objective-C 如虎添翼,具备了灵活的动态特性,使这门古老的语言焕发生机.主要内容如下: 引言 ...

  8. 记录一则ORA-00054,ORA-00031解决过程

    生产环境:AIX 5.3 + Oracle 10.2.0.5 任务要求:普通表改造分区表,历史数据不要   这个需求很简单: pl/sql导出建表语句,依次修改成分区的建表语句,注意将索引修改成本地索 ...

  9. 1Z0-053 争议题目解析704

    1Z0-053 争议题目解析704 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 704.View the Exhibit and examine the data manipul ...

  10. WebGIS中利用AGS JS+eChart实现一些数据展示的探索

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.背景 eChart提供了迁徙图.热点图.夜视图等跟地图能够很好的结 ...