`
zjjzmw1
  • 浏览: 1368807 次
  • 性别: Icon_minigender_1
  • 来自: 开封
社区版块
存档分类
最新评论

UIButton 图片的 平铺。

    博客分类:
  • iOS
阅读更多

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];

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics