반응형
UIImage *stampImg;
CGRect frame = CGRectMake(5 + (80 * (i % 4)), (70 * (i / 4)), 60, 60);
stampbtn = [[UIButton alloc] initWithFrame:frame];
stampImg = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"emo_%02d", i + 1] ofType:@"png"]];
[stampbtn addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[stampbtn setBackgroundImage:stampImg forState:UIControlStateNormal];
[stampbtn setBackgroundImage:stampImg forState:UIControlStateHighlighted];
[stampImg release];
[stampScoll addSubview:stampbtn];
CGRect frame = CGRectMake(5 + (80 * (i % 4)), (70 * (i / 4)), 60, 60);
stampbtn = [[UIButton alloc] initWithFrame:frame];
stampImg = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"emo_%02d", i + 1] ofType:@"png"]];
[stampbtn addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[stampbtn setBackgroundImage:stampImg forState:UIControlStateNormal];
[stampbtn setBackgroundImage:stampImg forState:UIControlStateHighlighted];
[stampImg release];
[stampScoll addSubview:stampbtn];
반응형
'개발 > 개발팁' 카테고리의 다른 글
SVN 오류 해결법 (0) | 2011.06.21 |
---|---|
[IB없이 개발하기]UIImage 넣기 (0) | 2011.05.09 |
[IB없이 개발하기] UILabel 붙이기 (0) | 2011.05.04 |
[IB없이 개발하기] 아이폰 키보드 감추기 (숨기기) (0) | 2011.05.04 |