iOS代码添加UIButton

            UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];

            [btn setFrame:CGRectMake(0, ver_start_point, 320, grid_H*3+15+matrix.frame.size.height)];

            [btn setTag:i];

            [btn addTarget:self action:@selector(btnPress:) forControlEvents:UIControlEventTouchUpInside];

            btn.backgroundColor = [UIColor redColor];

 

- (void)btnPress:(id)sender{

}

posted @ 2015-01-15 18:38  我去ios  阅读(387)  评论(0编辑  收藏  举报