下面是我们在cocoa touch静态库中使用的代码
UIbutton *imagebutton = [UIbutton buttonWithType:UIbuttonTypeCustom];imagebutton.frame = CGRectMake(self.vIEw.frame.size.wIDth-50,10,50,50);[imagebutton setimage:[UIImage imagenamed:@"close.png"] forState:UIControlStatenormal];imagebutton.adjustsImageWhenHighlighted = NO;// [imagebutton addTarget:self action:@selector(close:) forControlEvents:UIControlEventtouchUpInsIDe];[imagebutton addTarget:self action:@selector(hIDeWebVIEwBtn:) forControlEvents:UIControlEventtouchUpInsIDe];-(IBAction)hIDeWebVIEwBtn:(ID)sender { NSLog(@"HIDe button clicked"); [self.adVIEw removeFromSupervIEw]; self.adVIEw = nil; return; }
下面是集成和运行后在单视图应用程序中显示的屏幕截图.
一旦我点击按钮,它就不会被点击.
[self.mybutton sendActionsForControlEvents:UIControlEventtouchUpInsIDe];
它对我有用
总结以上是内存溢出为你收集整理的ios – UIButton从静态库触发时单击“不工作”全部内容,希望文章能够帮你解决ios – UIButton从静态库触发时单击“不工作”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)