美文网首页
iOS代码生成Button

iOS代码生成Button

作者: Zhen斌iOS | 来源:发表于2020-06-09 11:33 被阅读0次

    代码如下:

    CGRect frame = CGRectMake(0, 400, 72.0, 37.0);
    UIButton *button = [UIButton buttonWithType: UIButtonTypeRoundedRect];
    button.frame = frame;
    [buttonsetTitle:@"按钮"forState: UIControlStateNormal];
    button.backgroundColor = [UIColor clearColor];
    button.tag = 2000;
    [buttonaddTarget: self action: @selector(buttonClicked:) forControlEvents: UIControlEventTouchUpInside];
    [self.view addSubview: button];
    

    希望对你有帮助!

    相关文章

      网友评论

          本文标题:iOS代码生成Button

          本文链接:https://www.haomeiwen.com/subject/mdrstktx.html