RETableViewManager
RETableViewManager copied to clipboard
Is the title of REPickerItem can be changed?
I declared a REPickerItem : var infoItemLeftUp: REPickerItem! Then I do some initialization work of the REPickerItem. Then I change the title of the REPickerItem with: self.infoItemLeftUp.title = updatedLeftUpTitleString But the title did't change. Can't the title of REPickerItem be changed? Or I should change the title with another method?
are you using swift?
Yes, I'm using swift.
I'm using swift also and i'm not able to use the REPickerItem. If you're able to put in data and it doesn't crash I would love some sample code. It's the last piece of my app im trying to add.
@erinvilair
OK, here's the sample code: @IBOutlet weak var tableViewLeft: UITableView! var infoTableLeft: RETableViewManager! var infoSectionLeft: RETableViewSection! var infoItemLeftUp: REPickerItem!
And in viewDidLoad:
self.infoTableLeft = RETableViewManager(tableView: self.tableViewLeft)
self.infoTableLeft.tableView?.scrollEnabled = false
self.infoTableLeft.tableView?.layer.shadowOpacity = 1
self.infoTableLeft.tableView?.layer.shadowRadius = 10
self.infoTableLeft.tableView?.layer.shadowOffset = CGSizeMake(0, 0)
self.infoTableLeft.tableView?.layer.shadowColor = UIColor.grayColor().CGColor
self.infoTableLeft.tableView?.clipsToBounds = false
self.infoTableLeft.style.cellHeight = 100
self.infoSectionLeft = RETableViewSection()
self.infoTableLeft.addSection(infoSectionLeft)
self.infoItemLeftUp = REPickerItem(title: "--:--", value: ["时间"], placeholder: nil, options: [infoOptions])
self.infoSectionLeft.addItem(infoItemLeftUp)
Oh, by the way, the infoOptions is: var infoOptions = ["时间", "距离", "速度", "平均速度", "热量燃烧"]
Yea mines is crashing in the RETableViewPickerCell file:
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
THIS LINE--->>> return [[self.item.options objectAtIndex:component] count];
}
Error: unrecognized selector sent to instance 0x155837650 -[Swift._NSContiguousString count]: unrecognized selector sent to instance 0x155837650
Idk what i'm doing wrong I would love if I you can possibly help me with it via: email or text if possible. @erinvilair
Sorry man, but it seems not many relative APIs about RETableViewPickerCell given by the author. I haven't use it as well. Can you use REPickerItem instead of RETableViewPickerCell to fulfill your require?
@thankmelater23
Same issue here. Crashing on the same line. Any solution yet?
@thankmelater23 The format for the picker should be and array of arrays. The first array is the different components of the picker with sub array of items.
let options : [AnyObject]! = [ ["Male", "Female"] ]