UIImage * imgBtnReloadAllButton = [UIImage resizeableImageWithCapInsets2:UIEdgeInsetsMake(5, 5, 5, 5) withName:@"search_in_this_area"];
[self.btnReloadAllButton setBackgroundImage:imgBtnReloadAllButton forState:UIControlStateNormal];
PO([self.btnReloadAllButton backgroundImageForState:UIControlStateHighlighted]);
PO([self.btnReloadAllButton backgroundImageForState:UIControlStateNormal]);
PO([self.btnReloadAllButton backgroundImageForState:UIControlStateSelected]);
PO([self.btnReloadAllButton backgroundImageForState:UIControlStateReserved]);
PO([self.btnReloadAllButton backgroundImageForState:UIControlStateApplication]);
PO([self.btnReloadAllButton backgroundImageForState:UIControlStateDisabled]);
很简单。这就是我所看到的:
2013-03-19 15:22:22.349 BadgerNew[1724:c07] [self.btnReloadAllButton backgroundImageForState:UIControlStateHighlighted]: <_UIResizableImage: 0xd6b5a80>
2013-03-19 15:22:22.350 BadgerNew[1724:c07] [self.btnReloadAllButton backgroundImageForState:UIControlStateNormal]: <_UIResizableImage: 0xd6b5a80>
2013-03-19 15:22:22.350 BadgerNew[1724:c07] [self.btnReloadAllButton backgroundImageForState:UIControlStateSelected]: <_UIResizableImage: 0xd6b5a80>
2013-03-19 15:22:22.350 BadgerNew[1724:c07] [self.btnReloadAllButton backgroundImageForState:UIControlStateReserved]: <_UIResizableImage: 0xd6b5a80>
2013-03-19 15:22:22.382 BadgerNew[1724:c07] [self.btnReloadAllButton backgroundImageForState:UIControlStateApplication]: <_UIResizableImage: 0xd6b5a80>
2013-03-19 15:22:22.383 BadgerNew[1724:c07] [self.btnReloadAllButton backgroundImageForState:UIControlStateDisabled]: <_UIResizableImage: 0xd6b5a80>
(lldb) po imgBtnReloadAllButton
$0 = 0x0d6b5a80 <_UIResizableImage: 0xd6b5a80>
所以看起来所有按钮状态都指向同一个图像,即图像 0xd6b5a80
然而,当用户单击按钮时,在按下按钮之后但在抬起脏手指之前,按钮看起来不同。
基本上当我按下按钮时,按钮的底角不再是圆形的。
发生了什么?