开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜