level 2
灬ゞ宝小哲つ
楼主
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(30, 486, 40, 40) ];
[self.view addSubview:imageView];
imageView.image = [UIImage imageNamed:@"shiguang"];
imageView.userInteractionEnabled = YES;
UIButton *btn = [UIButton buttonWithType:UIButtonTypeContactAdd];
[imageView addSubview:btn];
[btn addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
}
一个的这样添加,那添加多个呢?怎么写??我是新手小白,求大神指点。。。
2015年11月06日 01点11分
1
[self.view addSubview:imageView];
imageView.image = [UIImage imageNamed:@"shiguang"];
imageView.userInteractionEnabled = YES;
UIButton *btn = [UIButton buttonWithType:UIButtonTypeContactAdd];
[imageView addSubview:btn];
[btn addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
}
一个的这样添加,那添加多个呢?怎么写??我是新手小白,求大神指点。。。