[問題] 關於Button highLight的顏色
各位好:
先附上DEMO
https://drive.google.com/file/d/0Bx3rZLw6NauYZWFTQ1ZBaFNZQVE/view?usp=sharing
現在遇到一個問題是我製作了一個TABLEVIEW 然後HIGHTLIGHT的時候
會將背景轉紅色,並也新增BUTTON想要達成同樣的效果,在stackoverflow
網站找到下方這個方法
- (UIImage *)imageWithColor:(UIColor *)color {
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
是可以轉變顏色,兩者同樣是red但Button的效果卻灰掉了,導致變成暗紅,自己嘗試了
很久仍然一樣,不確定BUTTON的HIGHTLIGH是如何運作的,想問一下有人遇過類似問題嗎?
不好意思 ,麻煩了
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.230.13.78
※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1465911144.A.8A6.html
推
06/15 09:45, , 1F
06/15 09:45, 1F
→
06/15 12:35, , 2F
06/15 12:35, 2F
→
06/15 13:40, , 3F
06/15 13:40, 3F
→
06/15 21:25, , 4F
06/15 21:25, 4F
→
06/16 08:57, , 5F
06/16 08:57, 5F
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章