inputAccessoryView显示成功,但它是完全黑色的。
_textField = [[UITextField alloc] initWithFrame: CGRectZero]; // update frame later
_textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
UIView *inputAccessoryView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 180)];
inputAccessoryView.backgroundColor = [UIColor blackColor];
inputAccessoryView.alpha = 0.2;
_textField.inputAccessoryView = inputAccessoryView;我完全不明白这一点...有人能解释一下为什么会这样吗?
发布于 2012-05-14 17:47:33
在前一行上使用此UIColor方法,而不是设置alpha:-
[UIColor colorWithHue:saturation:brightness:alpha:];https://stackoverflow.com/questions/10580845
复制相似问题