我正在尝试将子视图添加到UIButton.这个工作正常.但是,只要我添加子视图,该按钮就不再可以点击了.
我使用以下代码:
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(column*100+24, row*80+10, 64, 64);
[button addSubview:asyncImage];
[button addSubview:price];
[button addTarget:self
action:@selector(buttonClicked:)
forControlEvents:UIControlEventTouchUpInside];
Run Code Online (Sandbox Code Playgroud)
如果我删除了2个addsubviews,那么该按钮将再次起作用.如果有人知道如何解决这个问题那就太棒了!
日Thnx !!!