小编Raj*_*ran的帖子

如何以编程方式创建多个CheckBox

我有一个UITextViewUIViewController.其中UITextView,需要为备注插入多个CheckBox.

如何创建多个checkBox?

I have created Multiple CheckBoxes for `UIButton` Click, But When I Select or DeSelect operation, all ChecKBoxes Value changes.
Run Code Online (Sandbox Code Playgroud)

如何动态创建多个checkBox并为这些CheckBox创建方法?

可能吗?

这是我的代码:

-(void)Check
{
    CGPoint origin = note.frame.origin;
    NSString* head = [note.text substringToIndex:note.selectedRange.location];
    CGSize initialSize = [head sizeWithFont:note.font constrainedToSize:note.contentSize];
    NSUInteger startOfLine = [head length];

    NSString* tail = [head substringFromIndex:startOfLine];
    CGSize lineSize = [tail sizeWithFont:note.font forWidth:note.contentSize.width lineBreakMode:UILineBreakModeWordWrap];
    CGPoint cursor = origin;
    cursor.x += lineSize.width+15;
    cursor.y += initialSize.height - lineSize.height-130;

checkbox = [[UIButton alloc] …
Run Code Online (Sandbox Code Playgroud)

iphone checkbox objective-c uitextview ios

1
推荐指数
1
解决办法
5227
查看次数

标签 统计

checkbox ×1

ios ×1

iphone ×1

objective-c ×1

uitextview ×1