我目前使用Sensible TableView框架爲新應用程序創建搜索過濾器蒙版。 所有的工作都很好,但最新的Screendesign提供了新的問題。CustomController類作爲SensibleTableView中的CustomCell?
現在需要選擇最小值和最大值之間的範圍。現在我們不必使用兩個數字文本框來定義範圍,而是需要創建一種新的自定義RangeSlider類型(對於UISliderView來說很熟悉)。現在,我創建了RangeSlider(具有兩個縮略圖的Slider)作爲CustomClass,沒有xib文件。我現在必須在我的tableview中實現這個customCell? 仍然無法弄清楚如何通過STV做到這一點。
我RangeSlider需要一些屬性進行設置:
- 浮動minimumValue;
- float maximumValue;
- float minimumRange;
- float selectedMinimumValue;
- float selectedMaximumValue;
並通過更改屬性值來響應用戶交互。
我的問題在短期: 如何實現我的RangeSlider類作爲CustomCell,沒有XIB文件? And ..是否有可能使用SCUserDefaultsDefinition跟蹤我的customCell的userInteraction呢?
這就是我創造我STV方式:
SCUserDefaultsDefinition *userDefaultsDef = [SCUserDefaultsDefinition definitionWithDictionaryKeyNamesString:@"Search Filter:(gender,ageRangeSlider,zip,country)"];
SCPropertyDefinition *genderDef = [userDefaultsDef propertyDefinitionWithName:@"gender"];
genderDef.title = @"Gender";
genderDef.required = TRUE;
genderDef.type = SCPropertyTypeSelection;
genderDef.attributes = [SCSelectionAttributes attributesWithItems:[NSArray arrayWithObjects:@"f", @"m", nil] allowMultipleSelection:NO allowNoSelection:NO];
genderDef.autoValidate = TRUE;
/*#### CUSTOMCELL IMPLEMENTATION HERE #### */
SCPropertyDefinition *zip = [userDefaultsDef propertyDefinitionWithName:@"zip"];
zip.title = @"Zip-Code";
zip.type = SCPropertyTypeNumericTextField;
zip.attributes = [SCNumericTextFieldAttributes attributesWithMinimumValue:[NSNumber numberWithInt:01] maximumValue:[NSNumber numberWithInt:99] allowFloatValue:NO];
[self.tableViewModel generateSectionsForUserDefaultsDefinition:userDefaultsDef];
SCTableViewSection *formSection = [self.tableViewModel sectionAtIndex:0];
formSection.cellActions.valueChanged = ^(SCTableViewCell *cell, NSIndexPath *indexPath)
{
NSLog(@"\n\n*********** Key Binding Log ***********\n");
NSLog(@"Value: %@\n", [cell boundValue]);
};
將是巨大的,如果有人能幫助! 我真的很感激!請告訴我,如果你需要更多的信息。
感謝,
拉爾斯 (SRY我的英文不好)