0
我正在測試基於導航的應用程序在3.1.3加載的較舊iTouch上。問題是導航按鈕大小(使用自定義圖像)對於導航欄來說太大。 4.0並非如此。iPhone SDK:導航按鈕項目顯示過大
任何想法?以下是我用來創建它們的代碼。
//add done bar button - goes to email
UIButton *btnDone = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *imageDoneBtn = [[UIImage imageNamed:@"ButtonDone.png"]
stretchableImageWithLeftCapWidth:10 topCapHeight:10];
[btnDone setBackgroundImage:imageDoneBtn forState:UIControlStateNormal];
[btnDone addTarget:self action:@selector(email:)
forControlEvents:UIControlEventTouchUpInside];
btnDone.adjustsImageWhenDisabled = NO;
btnDone.adjustsImageWhenHighlighted = NO;
btnDone.frame = CGRectMake(0, 0, 49, 30);
UIBarButtonItem *btnItemDone = [[[UIBarButtonItem alloc]
initWithCustomView:btnDone] autorelease];
self.navigationItem.rightBarButtonItem = btnItemDone;