728x90
UIButton *button = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
button.frame = CGRectMake(0.0f, 0.0f, 49.0f, 30.0f);
[button setBackgroundImage:[UIImage imageNamed:@"btn_before.png"] forState:UIControlStateHighlighted];
[button setBackgroundImage:[UIImage imageNamed:@"btn_before_on.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(pressBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *temporaryBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:button];
[temporaryBarButtonItem setStyle:UIBarButtonItemStyleBordered];
self.navigationItem.leftBarButtonItem =temporaryBarButtonItem;
[button release];
[temporaryBarButtonItem release];
728x90
'Developer > iOS' 카테고리의 다른 글
[IPhone] String -> MD5(암호) 변환 샘플 (3) | 2011.03.21 |
---|---|
[IPhone]코드로 버튼 추가하기. (1) | 2011.03.21 |
[IPhone] TableView 터치시 파란색을 다른색으로 바꾸기 (1) | 2011.01.19 |
[IPhone] TabBarController의 TabBar(hidden) 숨기기. (1) | 2011.01.18 |
[IPhone] Twipic을 이용해서 이미지 업로드하기! (2) | 2011.01.12 |