iphone - UIButton in UITableViewCell -
i have uibutton image inside of uitableviewcell. when cell being highlight, button entering highlighted state (i.e. darker shade of image), regardless of whether user clicking within bounds of button or not.
i don't want functionality - want button highlighted when button clicked, not when entire cell being clicked.
i've tried set image in highlighted state same normal image. fixes issue stops button changing color when highlighted.
any ideas how achieve desired effect?
this driving me crazy. figured out need override sethighlighted:animated:
, setselected:animated:
- (void)sethighlighted:(bool)highlighted animated:(bool)animated { [super sethighlighted:highlighted animated:animated]; self.yourbutton.highlighted = no; } - (void)setselected:(bool)selected animated:(bool)animated { [super setselected:selected animated:animated]; self.yourbutton.selected = no; // if don't set highlighted no in method, // reason it'll highlighed while // table cell selection animates out self.yourbutton.highlighted = no; }
Comments
Post a Comment