0
我正在使用UIButton作为链接,theres一个更改将没有图像,所以我已设置为0高度,但其宽松的优先级,所以当我添加图像时它会扩大。问题是可点击区域不会随着图像的添加而扩大。以编程方式添加图像后更改UIButton点击区域
目前我试图添加像这样的图像。
[self.advertisementButton sd_setBackgroundImageWithURL:[NSURL URLWithString:url]
forState:UIControlStateNormal];
[self.advertisementButton setFrame:self.advertisementButton.imageView.bounds];
[self.advertisementButton layoutIfNeeded];
你设置'userInteractionEnabled = YES'你的'UIImageView'? – 2014-11-20 18:49:59
它是一个UIButton,它只在我点击图像的顶部时才起作用。 – plaidpancakes 2014-11-20 18:53:37
'sd_setBackgroundImageWithURL'做什么? – 2014-11-20 18:56:38