开发者

create a label when user click on the custom button in table view cell

开发者 https://www.devze.com 2023-04-11 16:43 出处:网络
In my app i have created custom cell with 2labels and one check button.when check button is clicked the seco开发者_运维知识库nd label should created.i have perform the checkbox functionality.it works

In my app i have created custom cell with 2labels and one check button.when check button is clicked the seco开发者_运维知识库nd label should created.i have perform the checkbox functionality.it works fine.but how to create label by clicking on the check button?


You would probably want your checkbox to be a UIButton with the type set to Custom. Then you could do something like:

-(IBAction)checkmarkTouchUpInside { UILabel *label = [[UILabel alloc] init]; label.text = @"Some Text"; // Add the label to the view here. }

Of course, you will need to connect the checkmarkTouchUpInside method to your control in Interface Builder or code.


What about just having the label already there and just hiding or unhiding as necessary?


When you click on the button call one method.There you have to reload the tableview.Then you have to add a label in cellForIndexPath.

0

精彩评论

暂无评论...
验证码 换一张
取 消