반응형
rss 아이콘 이미지

[IB없이 개발하기]UIImage 넣기

개발/개발팁 2011. 5. 9. 12:10 Posted by 법당오빠
반응형
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"넣고싶은 이미지.png"]];
    [imageView setFrame:CGRectMake(0, 0, 320, 460)];
    [self.view addSubview:imageView];

반응형

[IB없이 개발하기]UIButton 넣기

개발/개발팁 2011. 5. 4. 17:26 Posted by 법당오빠
반응형
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];
반응형

[IB없이 개발하기] UILabel 붙이기

개발/개발팁 2011. 5. 4. 17:23 Posted by 법당오빠
반응형
# UILabel

UILabel *label;
label = [[UILabel alloc] init];       
label.frame = CGRectMake(5 + (0 * (i % 25)), 39, 50, 20);
label.textAlignment = UITextAlignmentCenter;
label.backgroundColor = [UIColor clearColor];
label.font = [UIFont systemFontOfSize:10];
label.textColor = [UIColor whiteColor];
label.text = @"들어갈 텍스트";


반응형