UIButton

来源:互联网 发布:微波电路s参数矩阵 编辑:程序博客网 时间:2024/05/17 22:52

    UIButton*button=[UIButtonbuttonWithType:(UIButtonTypeRoundedRect)];

    

    button.frame=CGRectMake(150, 450, 100, 50);

    

    button.backgroundColor=[UIColorredColor];

    

    [button setTitle:@"Click"forState:UIControlStateNormal];

    

    //button交互事件-点击button改变label的文字

    [button addTarget:selfaction:@selector(gaibian)forControlEvents:UIControlEventTouchUpInside];

    

    [self.viewaddSubview:button];



0 0
原创粉丝点击