ghwghw4 / gicxmllayout Goto Github PK
View Code? Open in Web Editor NEW使用XML布局UI
License: MIT License
使用XML布局UI
License: MIT License
pod不下来
我尝试加一个tab进去
//
// GICTab.m
// GICXMLLayout_Example
//
// Copyright © 2019 ghwghw4. All rights reserved.
//
#import "GICTab.h"
@interface GICTab ()
{
NSString *rootPagePath;
NSMutableArray *controllers;
}
@end
@implementation GICTab
+(NSString *)gic_elementName{
return @"tab";
}
+(NSDictionary<NSString *,GICAttributeValueConverter *> *)gic_elementAttributs{
return @{
@"background-color":[[GICColorConverter alloc] initWithPropertySetter:^(NSObject *target, id value) {
[GICUtils mainThreadExcu:^{
// ((GICNav *)target).view.backgroundColor = value;
}];
}],
};
}
-(id)gic_willAddAndPrepareSubElement:(id)subElement{
if([subElement isKindOfClass:[UIViewController class]]){
[self pushViewController:subElement];
return subElement;
}
return [super gic_willAddAndPrepareSubElement:subElement];
}
-(id)gic_parseSubElementNotExist:(GDataXMLElement *)element{
// if([element.name isEqualToString:@"root-page"]){
// rootPagePath = [element attributeForName:@"path"].stringValue;
// return rootPagePath;
// }
return [super gic_parseSubElementNotExist:element];
}
-(void)gic_parseElementCompelete{
[super gic_parseElementCompelete];
// if(rootPagePath){
// [self push:rootPagePath];
// }
self.viewControllers = controllers;
}
#pragma mark router
-(void)pushViewController:(UIViewController *)viewController{
if(!controllers)
{
controllers = [[NSMutableArray alloc] init];
}
[controllers addObject:viewController];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
<app>
<tab>
<nav>
<root-page path="IndexPage.xml"/>
</nav>
<nav>
<root-page path="IndexPage.xml"/>
</nav>
</tab>
</app>
这样写是可以出来tab,然后我把GICListView的 RACWindowCount 改成1
if(self.visibleNodes.count==0){
// NOTE:这里之所以没有采用跟 insertRowsAtIndexPaths 一样的处理方式,那是因为,本身ASD的“bug"。因为如果在reloadDataWithCompletion的回调中后立马获取visibleNodes,这时候获取到的还是0。
[self reloadDataWithCompletion:^{
[subArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[self->insertItemsSubscriber sendNext:obj];
}];
}];
}else{
[self insertRowsAtIndexPaths:insertArray withRowAnimation:UITableViewRowAnimationNone];
[self onDidFinishProcessingUpdates:^{
if(subArray) [self dealItems:subArray];
}];
}
这时第二个tab里的list内容出现重复错乱.断点调试了下.
在第二个list这里self reloadDataWithCompletion后下一次进这个函数,self.visibleNodes.count一直是0,并不会进insertRowsAtIndexPaths.
代码改了下
self.visibleNodes.count==0 这个判断需要改成self.view.visibleCells.count==0 这样reloaddata后就会进else了,数据不会重复了
首先感谢开源 GICXMLLayout,公司团队计划尝试跟进。
团队希望 Android/iOS 两端体验尽量一致,请问Android 端应用开发是否有对应的方案或替代方案?
谢谢。
我用俩control 点击我改变了数据源,结果只有第一个control 状态变了 , 第二个不行, 一开始我以为这个 exp 不支持 ! 非写法 我用了 你demo里的 三目 exp=selectJobNumber?'false':'true' 依然不行 .为什么, 老哥
性能跟稳定性如何?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.