UIButton 图片的 平铺。
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 19, 300, 41) title:NSLocalizedString(@"DoneButton", "") textColor:ButtonWhiteColor backgroundImageNames:nil target:self action:@selector(clickCodeButton)];
UIEdgeInsets insets = UIEdgeInsetsMake(0, 8, 0, 8);
UIImage *tempImage = [UIImage imageNamed:@"button_logout_bg"];
UIImage *pressImage = [UIImage imageNamed:@"button_logout_bg_pres"];
tempImage = [tempImage resizableImageWithCapInsets:insets];
pressImage = [pressImage resizableImageWithCapInsets:insets];
[button setBackgroundImage:tempImage forState:UIControlStateNormal];
[button setBackgroundImage:pressImage forState:UIControlStateHighlighted];
[footerView addSubview:button];
[button release];
上一篇: PHP - 数组的排序函数
下一篇: 028.引用带出处,说话带语境