你的位置:首页 > 软件开发 > 操作系统 > 图片的简单拉伸操作

图片的简单拉伸操作

发布时间:2015-07-10 11:00:08
初始图片尺寸大小为 25 * 28 pixels现在我们在根试图上创建两个button UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = ...

图片的简单拉伸操作

初始图片图片的简单拉伸操作尺寸大小为 25 * 28 pixels

现在我们在根试图上创建两个button

 

    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

    button.frame = CGRectMake(50, 100, 25, 28);

    [button setBackgroundImage:[UIImage imageNamed:@"btn.png"] forState:UIControlStateNormal];

    [self.view addSubview:button];

    

    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];

    button1.frame = CGRectMake(50, 200, 200, 28);

  UIImage *image = [UIImage imageNamed:@"btn.png"];

   [button1 setBackgroundImage:image forState:UIControlStateNormal];

    [self.view addSubview:button1];

 没做拉伸处理前图片效果

原标题:图片的简单拉伸操作

关键词:图片

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。