- 2010/12/17 20:10
- nomadsoft.egloos.com/1213605
- 덧글수 : 0
- 2010/12/01 15:37
- nomadsoft.egloos.com/1154108
- 덧글수 : 0
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://쏼라쏼라.com/%@.jpg", imagename]];
NSData *htmlData = [NSData dataWithContentsOfURL:url]; //웹상의 이미지를 데이터로 만들지요.
//이미지가 있는건 데이터 길이로 체크해서 없으면 기본 이미지 표시
if ([htmlData length] > 0)
{
UIImage *img = [UIImage imageWithData:htmlData];
AView.image = img;
[AView setImage:img];
//이미지 둥글게 깍는부분.. 밑에 주석은 이미지에 테두리 두르기
// 요로코롬 레이어를 사용하려면 #import <QuartzCore/CALayer.h> 이걸 추가 해주세요
AView.layer.cornerRadius = 5.0;
AView.layer.masksToBounds = YES;
//And to add a border:
//imageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
//imageView.layer.borderWidth = 1.0;
}
else
{
UIImage *img = [UIImage imageNamed:@"Buddy.png"];
AView.image = img;
[AView setImage:img];
AView.layer.cornerRadius = 5.0;
AView.layer.masksToBounds = YES;
//And to add a border:
//imageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
//imageView.layer.borderWidth = 1.0;
}
- 2010/11/26 13:56
- nomadsoft.egloos.com/1138693
- 덧글수 : 1
//여기서 포인트는 CGRectMake의 Height을 결정하는 44.01f입니다.
//이걸 44.00f로 했더니 실제 구동시 위치가 잘못되어서 네비바가 틀어져 보이더군요.
//그래서 구글링을 해보니 이렇게 숫자를 바꿔주니 잘 처리되네요.
//그외 아래 소스를 이용하여 응용하여 필요한 기능을 구현해보세요~
UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 105.0f, 44.01f)];
[toolbar setBackgroundColor:[UIColor clearColor]];
// create an array for the buttons
NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:2];
UIImage *imageCheck = [UIImage imageNamed:@"buttonImage.PNG"];
UIButton *recvBtn = [UIButton buttonWithType:UIButtonTypeCustom];
recvBtn.bounds = CGRectMake(0.0f, 0.0f, 41.0f, 31.0f);
[recvBtn setImage:imageCheck forState:UIControlStateNormal];
[recvBtn addTarget:self action:@selector(OnRecvClick)
forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *btBack = [[UIBarButtonItem alloc] initWithCustomView:recvBtn];
[buttons addObject:btBack];
UIButton *sendBtn = [UIButton buttonWithType:UIButtonTypeCustom];
sendBtn.bounds = CGRectMake(0.0f, 0.0f, 41.0f, 31.0f);
[sendBtn setImage:imageCheck forState:UIControlStateNormal];
[sendBtn addTarget:self action:@selector(OnSendClick)
forControlEvents:UIControlEventTouchUpInside];
btBack = [[UIBarButtonItem alloc] initWithCustomView:sendBtn];
[buttons addObject:btBack];
[toolbar setItems:buttons animated:NO];
[buttons release];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:toolbar];
[toolbar release];
- 2010/11/11 11:29
- nomadsoft.egloos.com/1094801
- 덧글수 : 0
#import <QuartzCore/CALayer.h>
layer.borderColor = [[UIColor blueColor] CGColor];
layer.borderWidth = 3.0f;
layer.cornerRadius = 60.0f;
- 2010/11/10 10:32
- nomadsoft.egloos.com/1092124
- 덧글수 : 0
componentsSeparatedByString <- 바로 이 메쏘드입니다.
이 메쏘드를 사용하면 배열을 리턴하는데 이걸 가져다 쓰면 쉽게 사용할수 있겠네요.
Array - [nsstring componentsSeparatedByString:@"|"]
- 2010/11/10 09:39
- nomadsoft.egloos.com/1092052
- 덧글수 : 0
- 2010/11/10 09:15
- nomadsoft.egloos.com/1092036
- 덧글수 : 0
- 2010/11/10 09:07
- nomadsoft.egloos.com/1092026
- 덧글수 : 0
- 2010/11/09 13:12
- nomadsoft.egloos.com/1089743
- 덧글수 : 0


최근 덧글