我有一個自定義的UIButton下面的代碼:自定義UIButton圓形角落變得高亮?
btnLogin.layer.cornerRadius = 10;
[btnLogin setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bluetint.png"]]];
[btnLogin setAlpha:1];
[btnLogin setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[btnLogin setBackgroundImage:[UIImage imageNamed:@"reallybluetint.png"] forState:UIControlStateHighlighted];
[btnLogin setBackgroundImage:[UIImage imageNamed:@"reallybluetint.png"] forState:UIControlStateSelected];
當我強調,即使它在正常狀態下具有圓角就變成方形的按鈕。
任何想法?
使用uicontrolstate突顯了創建一個默認的按鈕。因此方角。如果你喜歡,我可以告訴你如何創建與石英核心按鈕。 – 2013-04-20 04:55:14