相关疑难解决方法(0)

导航视图的背景图像

我在正确显示导航视图的背景图像时遇到问题.这是图片:

替代文字

这是代码:

- (id)initWithStyle:(UITableViewStyle)style {
    if (self = [super initWithStyle:style]) {

        UIImage *image = [UIImage imageNamed: @"bg_table_active.png"];
        UIImageView *imageview = [[UIImageView alloc] initWithImage: image];
        UIBarButtonItem *addButton = [[UIBarButtonItem alloc]
                                       initWithTitle:NSLocalizedString(@"Settings", @"")
                                       style:UIBarButtonItemStyleDone
                                       target:self
                                       action:@selector(GoToSettings)];
        self.navigationItem.titleView = imageview;
        self.navigationItem.rightBarButtonItem = addButton;
        self.navigationItem.hidesBackButton = TRUE;
    }
    return self;
}
Run Code Online (Sandbox Code Playgroud)

如何将图片拉伸到整个导航视图?

iphone uinavigationbar

10
推荐指数
2
解决办法
3万
查看次数

在xcode中将图像添加到导航栏?

我在xib中添加了导航栏和导航项.现在我需要在导航栏的左侧添加图像,但它没有被添加.这是我正在处理的代码:

- (void)viewDidLoad
{
UIImage *image = [UIImage imageNamed: @"i_launcher.png"];
    UIImageView *imageView = [[UIImageView alloc] initWithImage: image];
    self.navigationItem.titleView = imageView;
    [imageView release];
}
Run Code Online (Sandbox Code Playgroud)

我无法理解为什么图像没有被添加.我该如何添加它?

iphone xcode uinavigationbar

2
推荐指数
2
解决办法
2万
查看次数

标签 统计

iphone ×2

uinavigationbar ×2

xcode ×1