iotjin / jhform Goto Github PK
View Code? Open in Web Editor NEWJhForm - 自定义表单工具,更加简单,快捷的创建表单、设置页面
JhForm - 自定义表单工具,更加简单,快捷的创建表单、设置页面
JhFormCellModel *Section1_cell1 = JhFormCellModel_AddCustumALLViewCell(100);
Section1_cell1.Jh_custumALLViewBlock = ^(UIView * _Nonnull allView) {
//allView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 100);
UIButton * imageBtn = [UIButton buttonWithType:UIButtonTypeCustom];
imageBtn.frame = CGRectMake(0, 0, 100, 100);
imageBtn.titleLabel.lineBreakMode = 0;//这句话很重要,不加这句话加上换行符也没用
imageBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
imageBtn.titleLabel.numberOfLines = 0;
[imageBtn setTitle:[NSString stringWithFormat:@"+添加图片(可无)"] forState:UIControlStateNormal];
imageBtn.backgroundColor = [UIColor yellowColor];
[imageBtn addTarget:self action:@selector(chageBtnImage:) forControlEvents:UIControlEventTouchUpInside];
self.imageBtn = imageBtn;
[allView addSubview:imageBtn];
UIButton * deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
deleteBtn.frame = CGRectMake(70, 0, 30, 30);
deleteBtn.hidden = YES;
[deleteBtn setImage:[UIImage imageNamed:@"compose_picture_add"] forState:UIControlStateNormal];
deleteBtn.backgroundColor = [UIColor redColor];
[deleteBtn addTarget:self action:@selector(delebtn) forControlEvents:UIControlEventTouchUpInside];
[imageBtn addSubview:deleteBtn];
self.deleteBtn = deleteBtn;
};
你样例Demo 中显示,但是在我的项目工程中还是不显示。
只能手动导入吗
Jh_isUseUrlShowPicture 设置为yes ,请求网络图片回显,刷新后会走setData方法,闪退
重新设置cell的高度,发现cell中的标题已经内容都不是居中显示,比如textView在cell增高时,内容显示无法居中
不支持 年月日 日期选择
可以增加提交按钮的背景颜色和字体修改吗?
在作为子控制器添加的时候,TableView位置向下偏移,因为导航高度写为固定的。
JhFormConst.h 第26行
#define Jh_NavHeight (Jh_StatusBarHeight + Jh_ContentNavBarHeight)
JhFormTableViewVC.m 第97行
tableView.frame = CGRectMake(0, Jh_NavHeight, Jh_ScreenWidth, Jh_ScreenHeight-Jh_NavHeight-Jh_BottomSafeHeight);
能否提供接口,修改这个值?
或许可以修改为更灵活的接入方式。
你好,框架十分好用,十分感谢,但是项目需求要可以上传视频和音频,我只是一个刚学iso3个月的小菜鸡,还只能用用别人写好的东西,如果能实现的话,万分感谢!
更项目需求很一致,但是需要适配swift,iOS13
继承 JhFormTableViewVC
(void)viewDidLoad {
[super viewDidLoad];
[self setNav];
[self initModel];
}
#pragma mark - setNav
-(void)setNav{
self.Jh_navTitle = @"帮助中心";
// self.Jh_hiddenDefaultFooterView = YES;
self.view.backgroundColor = [UIColor whiteColor];
self.Jh_formTableView.backgroundColor = [UIColor whiteColor];
self.Jh_formTableView.separatorColor = [UIColor clearColor];
}
#pragma mark - initModel
-(void)initModel{
__weak typeof(self) weakSelf = self;
NSMutableArray *cellArr0 = [NSMutableArray array];
JhFormCellModel *cell1 = JhFormCellModel_AddRightArrowCell(@"常见问题", @"");
self.Jh_submitStr = @"我要反馈";
self.Jh_submitBtn.backgroundColor = defaultThemeColor;
self.Jh_formSubmitBlock = ^{
NSLog(@" 点击提交按钮 ");
};
[cellArr0 addObjectsFromArray: @[cell1]];
JhFormSectionModel *section0 = JhSectionModel_Add(cellArr0);
[self Jh_addSectionModel:section0];
}
添加这个到模型数组 [self Jh_addSectionModel:section0]; ,不添加这句不提示。
第三方检测工具MLeaksFinder 提示
Possibly Memory Leak.
In case that JhFormTableView should not be dealloced, override -willDealloc in JhFormTableView by returning NO.
View-ViewController stack: (
HelpCenterViewController,
UIView,
JhFormTableView
)
这会导致所有presentInViewController 背景都是黑屏。
JhFormCellModel *cell7 = JhFormCellModel_AddImageCell(title, NO);
cell7.Jh_tipsInfo =@"长按可以调整图片顺序";
cell7.Jh_titleTextColor = [UIColor redColor];
[cellArr0 addObjectsFromArray: @[cell3,cell7]];
JhFormSectionModel *section0 = JhSectionModel_Add(cellArr0);
[self.Jh_formModelArr addObject:section0];
self.JhClickNavRightItemBlock = ^{
//这里我已经选择图片了,但是有时候他会是空的.。不知道是怎么回事。
NSLog(@" 99999选择图片类 - Jh_selectImageArr: %@ ",cell7.Jh_selectImageArr)
};
非常好,非常感谢作者。非常感谢作者的贡献。
重新加载表单,已选择的图片和单选按钮没有清空
当表单上有多个按钮样式cell切换更改数据源 会出现重用问题
JhFormTableViewVC *tableViewVC = [[JhFormTableViewVC alloc]init];
tableViewVC.Jh_formTableView.frame = CGRectMake(15, 15, IPHONE_WIDTH-30, 45*6);
[self addChildViewController:tableViewVC];
[self.view addSubview:tableViewVC.view];
[tableViewVC didMoveToParentViewController:self];
JhFormCellModel *cell0 = JhFormCellModel_AddRightArrowCell(VSLocalizedString(@"ADD_STAFF_PHOTO"), @"");
这种情况右按钮图片会和右箭头重叠
最新版的HXPhotoPicker 没有兼容?兼容的是HXPhotoPicker的哪个版本?
你好,框架十分好用,十分感谢。
但cell貌似没有可以添加视频的cell,可以拓展一下吗
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.