如何實現這樣的按鈕?透明的UIBarButtonItem
http://dl.dropbox.com/u/21379266/barButtonItemTransparency.png
當我使用setBackgroundImage:forState:barMetrics:
和使用模式的圖像,我沒有邊框,陰影,漸變......
還與[UIColor clearColor]
不工作在所有試圖setTintColor:
。
任何想法?
如何實現這樣的按鈕?透明的UIBarButtonItem
http://dl.dropbox.com/u/21379266/barButtonItemTransparency.png
當我使用setBackgroundImage:forState:barMetrics:
和使用模式的圖像,我沒有邊框,陰影,漸變......
還與[UIColor clearColor]
不工作在所有試圖setTintColor:
。
任何想法?
嘗試設置自定義視圖爲您的UIBarButtonItem
UIBarButtonItem* bar = YOUR_BAR_BUTTON;
bar.customView = [[[UIImageView alloc] initWithImage:@"YOUR_IMAGE"] autorelease];
bar.customView.alpha = .5;
我不知道你的目標是什麼IOS版本,但如果你在iOS 5中,您可以使用UIAppearance
協議設置自定義背景圖片。
但請注意,背景圖片必須是可拉伸的!
-1對於斷開鏈接 – 2012-10-16 14:36:54