在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:alibaba/VirtualView-iOS开源软件地址:https://github.com/alibaba/VirtualView-iOS开源编程语言:Objective-C 99.1%开源软件介绍:VirtualViewA solution to create & release UI component dynamically. It a part of our Tangram solution. And it can be used as a standalone library. 这是一个动态化创建和发布 UI 组件的方案。 它是我们 Tangram 方案的一部分。当然它也可以独立使用。 中文介绍:VirtualView iOS 中文文档:VirtualView通用文档,VirtualView iOS文档 Features
简单总结起来就是用 XML 描述一个组件,用我们提供的工具编译成 .out 二进制文件,在集成了 VirtualView 的 App 里直接加载 .out 文件就可以得到一个组件,然后像使用普通 UIView 一样使用它就好了。 InstallCocoaPodsUse VirtualView alone:
Use VirtualView with Tangram:
CocoaPods will install VirtualView as a part of Tangram 2.x. Source codesOr you can download source codes from releases page and put them into your project. How to use
if (![[VVTemplateManager sharedManager].loadedTypes containsObject:@"icon_type"]) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"icon_file" ofType:@"out"];
[[VVTemplateManager sharedManager] loadTemplateFile:path forType:@"type_alias"];
}
self.viewContainer = [VVViewContainer viewContainerWithTemplateType:@"icon_type"];
[self.view addSubview:self.viewContainer];
self.viewContainer.frame = CGRectMake(0, 0, SCREEN_WIDTH, 1000);
[self.viewContainer update:@{
@"type" : @"icon-type",
@"imgUrl" : @"https://test.com/test.png"
}];
[self.viewContainer updateData:@{
@"type" : @"icon-type",
@"imgUrl" : @"https://test.com/test.png"
}];
CGSize size = CGSizeMake(MAX_WIDTH, MAX_HEIGHT);
size = [self.viewContainer estimatedSize:size];
self.viewContainer.frame = CGRectMake(0, 0, size.width, size.height);
[self.viewContainer updateLayout]; See more details in the demo project. XML Compile ToolsAn executable jar (need Java 1.8) is in the CompileTool path. In the demo project, we use bash script to sync XML template changes. You can find the script here: See more details here. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论