的背景颜色,我创造了我所使用的用户registration.In注册页面的应用程序,我已经创造了许多UITextFields.I希望,当用户选择的任何文本字段那么它的背景图像的变化。我使用的代码是这样做的:更改所选文本字段
- (IBAction)touchBegin:(id)sender
{
//UILabel *opt = (UILabel *)[cell viewWithTag:101];
if (_text1.isSelected) {
_text1.background = [UIImage imageNamed:@"big_star_non_rating.png"];
}
else if (_text2.isSelected){
_text2.background = [UIImage imageNamed:@"big_star_non_rating.png"];
}
else if (_text3.isSelected){
_text3.background = [UIImage imageNamed:@"big_star_non_rating.png"];
}
else if (_text4.isSelected){
_text4.background = [UIImage imageNamed:@"big_star_non_rating.png"];
}
else{
}
}
但我没有得到根据我的需要的结果。 我应该用什么来获得正确的输出?
什么是您的文本字体样式?边框风格还是什么? – Maul 2014-10-01 10:01:31