我做了一个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