快速連結

2013年7月22日

背景圖無限重複祕技

使用以下圖片,拼成滿版背景的方法

在APP內拼成花花的背景:





    UIGraphicsBeginImageContext(self.frame.size);
    UIImage *imger = [UIImage imageNamed:@"background-pattern.png"];
    [imger drawAsPatternInRect:self.bounds];
    UIImage *pimg = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndPDFContext();
    self.backgroundColor = [UIColor colorWithPatternImage:pimg];

沒有留言:

張貼留言

歡迎大家留言提問,我會答的都會盡力回答!
如果太久沒出現回應就是我又忘記回來看留言了TAT