nui
nui copied to clipboard
Style is not applied to Button in UITableViewCell
Hi
I try to apply a custom style to a button in a UITableViewCell if the button is pressed. Kind of like a radiobutton we know from HTML. However, the style is never applied. although i can change the Title of the button.
- (void)buttonPressed:(id)sender event:(id)event{
NSSet *touches = [event allTouches];
UITouch *touch = [touches anyObject];
CGPoint currentTouchPosition = [touch locationInView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:currentTouchPosition];
FileProtectionCell *cell = (FileProtectionCell*)[self.tableView cellForRowAtIndexPath:indexPath];
[cell.button setTitle:@"active" forState:UIControlStateNormal];
cell.button.nuiClass = @"LargeButton";
[NUIRenderer renderButton:cell.button];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.section == kSectionProtection){
FileProtectionCell *cell = (FileProtectionCell*)[tableView dequeueReusableCellWithIdentifier:@"FileProtectionCell"];
[cell.button addTarget:self action:@selector(buttonPressed:event:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
return nil;
}
can somebody verify this? is this a known issue?
I have seen something similar with UITextViews. I am looking into it.