這裏_danView是解開UIWebView的addSubView UIButton的按鈕點擊事件沒有響應
和自我是一個UIWebView
使用_danView.frame = CGRectMake(windowWidth +randWindth, gaodu+[heiArr[i]intValue], size.width+40+(size.height+8)/2, size.height+8);
_danView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"danmaku_bg"]];
_danView.userInteractionEnabled = YES;
self.userInteractionEnabled = YES;
[_danView addTarget:self action:@selector(tapClick) forControlEvents:UIControlEventTouchUpInside];
_danView.layer.cornerRadius = (size.height+8)/2;
_danView.layer.masksToBounds = YES;
[self addSubview:_danView];
// [_danView addSubview:label];
[self animationWithView:_danView];
-(void)tapClick{
NSLog(@"click click");
}
謝謝!但按鈕不是用XIB創建的 –
這不是問題你還是可以做到的.. –