2009-06-22 2 views

답변

6

예, 레이블에는 패턴 색상이있을 수 있습니다.

// make a UIColor with an image as the pattern 
UIImage *tileImage = [UIImage imageNamed:@"hot_grad_64px.png"]; 
UIColor *patternColorTile = [UIColor colorWithPatternImage:tileImage]; 

// assign it to the .textColor property of a UILabel 
self.testLabel.textColor = patternColorTile; 

// the pattern will only align if both the .frame property of the 
// label AND the font size is the same as the image tile height 

패턴

alt text http://img178.imageshack.us/img178/1995/textwithpatterncolor.png

여러 색깔 패턴을 전환함으로써 애니메이트 될 수있다. > 30fps에서 패턴 이미지와 일반 색상을 뒤집어서 iPhone 장치가 잘 유지됩니다.

이미지 타일이 작 으면 어떤 이유도 보이지 않지만 광범위하게 프로파일 링하지 않았습니다.

+0

글꼴 크기가 커지면서이 채우기 색상이 늘어나고 크기가 재밌어지며, 어떤 생각을 고칠 수 있습니까? – jjxtra

+0

@PsychoDad는 텍스처 이미지의 크기를 조절합니다. –

관련 문제