Repeat image horizontally and vertically

前端 未结 5 1410
刺人心
刺人心 2020-12-05 05:29

I want to repeat the following image:

\"enter

to achieve the following backgro

5条回答
  •  借酒劲吻你
    2020-12-05 05:45

    this with Bellow Method using stretchableImageWithLeftCapWidth like this way:-

    UIImage *backgroundImage = [[UIImage imageNamed:@"SheetBackground.png"] stretchableImageWithLeftCapWidth:0.5 topCapHeight:0];
    

    as par your need example:-

    UIImage *backgroundImage = [[UIImage imageNamed:@"q4Ses.png"] stretchableImageWithLeftCapWidth:0.5 topCapHeight:0];
    
      [_scro setBackgroundColor:[UIColor colorWithPatternImage:backgroundImage]];
    

提交回复
热议问题