2012-07-26 53 views
0

我使用自定義視圖來設置導航欄上的UIButton。自定義導航按鈕,但文本不清晰,因爲系統

但是,像下面的按鈕上的文本:

enter image description here

不喜歡默認的按鈕上的文字說清楚。

enter image description here

我嘗試添加該按鈕另一個標籤,但似乎失敗了。

我也綁這樣的代碼,但似乎也無法正常工作。

doneButton.titleLabel.layer.shadowColor = [UIColor blackColor].CGColor; 
doneButton.titleLabel.layer.shadowOffset = CGSizeMake(0, -1.0); 

回答

0

這些代碼運行良好。

button.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]]; 
button.titleLabel.textColor = [UIColor whiteColor]; 
button.titleLabel.shadowOffset = CGSizeMake(0,-1); 
button.titleLabel.shadowColor = [UIColor darkGrayColor]; 

我從https://github.com/boctor/idev-recipes這是自定義UI實現很大的得到它。