3
我正在使用XLForm
和XLFormRowDescriptor
。其他一切工作正常,但我有一個要求,我想在圖像和文本使用自定義行。另外我需要在XLFormRowDescriptor action
上做XLFormRowDescriptorTypeSelectorPush
。XLForm具有圖像和文本以及按動控制器的自定義行的行爲目標C
我正在使用XLForm
和XLFormRowDescriptor
。其他一切工作正常,但我有一個要求,我想在圖像和文本使用自定義行。另外我需要在XLFormRowDescriptor action
上做XLFormRowDescriptorTypeSelectorPush
。XLForm具有圖像和文本以及按動控制器的自定義行的行爲目標C
從XLFormBaseCell子類(你也可以創建自定義的廈門國際銀行,如果你喜歡使用IB),並實施
+ (void)load {
XLFormViewController.cellClassesForRowDescriptorTypes[@"YOUR_UNIQ_TYPE"] = NSStringFromClass([CHILD_OF_XLFormBaseCell class]);
}
- (void)configure {
[super configure];
}
- (void)update {
[super update];
}
+ (CGFloat)formDescriptorCellHeightForRowDescriptor:(XLFormRowDescriptor *)rowDescriptor;
爲了不使用默認的操作(如XLFormRowDescriptorTypeSelectorPush),你可以重寫此方法:
- (void)formDescriptorCellDidSelectedWithFormController:(XLFormViewController *)controller {
//anything you want, for example
if (self.rowDescriptor.action.formBlock) {
self.rowDescriptor.action.formBlock(self.rowDescriptor);
}
}
然後你就可以使用創建XLFormRowDescriptor
- (instancetype)initWithTag:(NSString *)tag rowType:(NSString *)rowType title:(NSString *)title;