[問題] UISegmentedControl 透明背景
大家好,請問UISegmentedControl 有辦法設置透明背景嗎?
附上Sample Code...
if(self.flashSegmentedView==nil)
{
NSArray *itemArray =[NSArray arrayWithObjects:NSLocalizedString(MLS_Auto,nil)
,NSLocalizedString(MLS_Open,nil)
,NSLocalizedString(MLS_Close,nil), nil];
flashSegmentedView_ = [[UISegmentedControl alloc] initWithItems:itemArray];
self.flashSegmentedView.backgroundColor = [UIColor clearColor];
self.flashSegmentedView.segmentedControlStyle = UISegmentedControlStyleBar;
[self.flashSegmentedView setTintColor:[UIColor clearColor]
forTag:ButtonID_Auto];
...
[self.flashSegmentedView setTextColor:[UIColor whiteColor]
forTag:ButtonID_Auto];
...
[self.flashSegmentedView setShadowColor:[UIColor clearColor];
...
}
出來是灰黑色背景..白字
具體的做法我是參考:
http://www.framewreck.net/2010/07/custom-tintcolor-for-each-segment-of.html
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.163.14.75
※ 編輯: s8911124 來自: 118.163.14.75 (04/30 10:53)
推
04/30 11:51, , 1F
04/30 11:51, 1F
→
05/03 16:46, , 2F
05/03 16:46, 2F