我做了一個iPad應用程序,在我的導航控制的標題,圖像中目標C導航欄
現在標題欄,我希望把圖像在左邊,所以我隱藏標題欄用標籤,但標籤不覆蓋標題欄的整個寬度
IL APP在屏幕SHOT,
這裏是代碼片段,
UILabel *titleView = (UILabel *)self.navigationItem.titleView;
if (!titleView) {
titleView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 800, 50)];
titleView.backgroundColor = [UIColor clearColor];
titleView.font = [UIFont boldSystemFontOfSize:20.0];
titleView.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.5];
titleView.textColor = [UIColor yellowColor]; // Change to desired color
titleView.backgroundColor=[UIColor blackColor];
titleView.text = @"IL APP";
titleView.textAlignment=UITextAlignmentCenter;
//self.navigationItem.titleView = titleView;
[self.navigationItem setTitleView:titleView];
[titleView release];
}
我不明白你的預期結果是什麼。你能解釋一下嗎? – 2012-01-13 06:05:23
在標題欄中,我用黃色書寫了IL APP,我想將圖像放在那裏,在左側.... – GAMA 2012-01-13 06:08:43
您必須在導航欄的左側顯示標籤? – Hiren 2012-01-13 06:14:05