Accessing custom cell attributes outside of cellForRowAtIndexPath

前端 未结 3 691
悲&欢浪女
悲&欢浪女 2020-12-11 22:07

I want some thing like image below. User can click on + or - button and the increased or decreased count is display in UILabel i.e 1 in the image below.
I know how to im

3条回答
  •  自闭症患者
    2020-12-11 22:40

    use steeper control in custom tableview cell.

    this is my screen.i used stepper control and label.

    customcell.h class

    @property (weak, nonatomic) IBOutlet UIStepper *stepper;
    @property (weak, nonatomic) IBOutlet UILabel *lbl_value;
    

    ****customcell.m****

    - (IBAction)stepper:(UIStepper *)sender {
        NSUInteger value = sender.value;
        lbl_value.text = [NSString stringWithFormat:@"%03d",value];
        self.txt1.text= [NSString stringWithFormat:@"%03d",value];
    
    }
    

提交回复
热议问题