#import <Foundation/Foundation.h>
@interface LWNavigationBar : UINavigationBar {
UIImage *background;
}
@end
@implementation LWNavigationBar
- (void)drawRect:(CGRect)rect
{
if(background == nil)
background = [UIImage imageNamed:@"cs1_header.png"];
[background drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
- (void)dealloc {
[background release];
[super dealloc];
}
@end
Interface Builder 에서 Navigation Controller 안의 Navigation Bar의 클래스를 위에 것으로 변경하고
소스애서 background property에 이미지 지정.
'iOS Programming' 카테고리의 다른 글
Multiline UILabel의 수직 정렬 (Top / Center / Bottom) (0) | 2010.09.10 |
---|---|
애니메이션효과로 탭바 숨기고 보이기 (0) | 2010.09.10 |
cocoa touch 에서의 간단한 pdf 핸드링 (0) | 2010.09.10 |
UITableViewCell에 Badge 달기 (0) | 2010.09.10 |
iPhone SDK 4.0에서 기존 프로젝트의 Base SDK missing 문제 해결하기 (1) | 2010.06.22 |