更新时间 : 2021-02-22 09:31:06
替换方法需要根据规范组织参数内容,请先点击以下链接了解
普通图片
常用于替换动态模板中某个指定位置的用户头像
文字
常用于给动态模板每张图片绑定字幕
[_mTemplate commit];//替换方法需要在commit之后调用
NSMutableArray *infoArray = [NSMutableArray array];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"logo",
@"d_img_paths" : @[[[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"replaceAssets/logo.png"]]
}];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"headimg",
@"d_img_paths" : @[[[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"replaceAssets/avatar.jpeg"]]
}];
[_mTemplate setDynamicSubFiles:infoArray];
文字素材替换时我们会进行文字绘制,素材文件存放在“tmp/sxve_tmp”文件夹下,在绘制时我们会根据素材所规定的大小对文字字号进行自适应,但不对文字长度做上限,所以用户需要对替换的文字长度做好检查,文字自适应最小字号为4号。
[_mTemplate commit];//替换方法需要在commit之后调用
NSMutableArray *infoArray = [NSMutableArray array];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"title",
@"d_texts" : @[@"标题,居中"]
}];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"brief",
@"d_texts" : @[@"文字精确替换,共三行,居左显示,相册简介"]
}];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"summary",
@"d_texts" : @[@"文字精确替换,共三行,居中显示,相册描述"]
}];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"endbrief",
@"d_texts" : @[@"文字精确替换,共三行,居右显示,相册鸣谢"]
}];
[infoArray addObject:@{@"img_path" : [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"1.jpeg"],
@"index" : @(0),
@"d_key_prefix" : @"dtext",
@"d_texts" : @[@"相册1"]
}];
[infoArray addObject:@{@"img_path" : [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"1.jpeg"],
@"index" : @(1),
@"d_key_prefix" : @"dtext",
@"d_texts" : @[@"相册2"]
}];
[infoArray addObject:@{@"img_path" : [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"@"1.jpeg"],
@"index" : @(2),
@"d_key_prefix" : @"dtext",
@"d_texts" : @[@"相册3"]
}];
[infoArray addObject:@{@"img_path" : [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"2.jpeg"],
@"index" : @(0),
@"d_key_prefix" : @"dtext",
@"d_texts" : @[@"相册4"]
}];
[_mTemplate setDynamicSubTexts:infoArray];
替换方法需要根据规范组织参数内容,请先点击以下链接了解
普通图片
常用于替换动态模板中某个指定位置的用户头像
文字
常用于给动态模板每张图片绑定字幕
[_mTemplate commit];//替换方法需要在commit之后调用
NSMutableArray *infoArray = [NSMutableArray array];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"logo",
@"d_img_paths" : @[[[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"replaceAssets/logo.png"]]
}];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"headimg",
@"d_img_paths" : @[[[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"replaceAssets/avatar.jpeg"]]
}];
[_mTemplate setDynamicSubFiles:infoArray];
文字素材替换时我们会进行文字绘制,素材文件存放在“tmp/sxve_tmp”文件夹下,在绘制时我们会根据素材所规定的大小对文字字号进行自适应,但不对文字长度做上限,所以用户需要对替换的文字长度做好检查,文字自适应最小字号为4号。
[_mTemplate commit];//替换方法需要在commit之后调用
NSMutableArray *infoArray = [NSMutableArray array];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"title",
@"d_texts" : @[@"标题,居中"]
}];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"brief",
@"d_texts" : @[@"文字精确替换,共三行,居左显示,相册简介"]
}];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"summary",
@"d_texts" : @[@"文字精确替换,共三行,居中显示,相册描述"]
}];
[infoArray addObject:@{@"img_path" : @"",
@"d_key_prefix" : @"endbrief",
@"d_texts" : @[@"文字精确替换,共三行,居右显示,相册鸣谢"]
}];
[infoArray addObject:@{@"img_path" : [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"1.jpeg"],
@"index" : @(0),
@"d_key_prefix" : @"dtext",
@"d_texts" : @[@"相册1"]
}];
[infoArray addObject:@{@"img_path" : [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"1.jpeg"],
@"index" : @(1),
@"d_key_prefix" : @"dtext",
@"d_texts" : @[@"相册2"]
}];
[infoArray addObject:@{@"img_path" : [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"@"1.jpeg"],
@"index" : @(2),
@"d_key_prefix" : @"dtext",
@"d_texts" : @[@"相册3"]
}];
[infoArray addObject:@{@"img_path" : [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"2.jpeg"],
@"index" : @(0),
@"d_key_prefix" : @"dtext",
@"d_texts" : @[@"相册4"]
}];
[_mTemplate setDynamicSubTexts:infoArray];