看板 MacDev 關於我們 聯絡資訊
我把image做翻轉 再設給UIButton 達到"把UIButton的image翻轉的效果" UIImage *image = [UIImage imageWithCGImage:[UIImage imageNamed:@"xxx"].CGImage scale:2.0 orientation:UIImageOrientationUpMirrored]; [_btn setImage:image forState:UIControlStateNormal]; 但是在按下btn之後(UIControlStateHighlight) image的方向卻是跟翻轉前的一樣 http://imgur.com/fSyU9J6 可是如果用 [_btn setImage:image forState:UIControlStateHighlight]; 就不會有「變灰」的效果 請問該如何讓highlight狀態同時有「翻轉」及「變灰」的效果? 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.36.60.160
tom19830924:叫Art做新圖? 或是改原圖Context Alpha? 10/29 18:03
ahchie:試試[_btn setBackgroundImage:image forState:highlight]? 10/29 18:14
whitefur:樓上的方法試過了 10/29 19:43
yuanruo:繼承uibutton 覆寫touch事件? 10/29 22:49
yuanruo:或是UIcontrol的 setHighlighted: (BOOL) highlighted 10/29 22:58