UIBarButtonItem回去没出现?

时间:2016-04-22 11:35:48

标签: ios objective-c uibarbuttonitem

我不知道为什么在按下桌子上的单元格后没有显示后退按钮。现在我在父控制器(你单击单元格以移动到下一个视图)上读取它应该插入此代码:

    $http.get("http://"+$localStorage.ip+":"+$localStorage.port+"/exportDB").success(function(response) {
        var dataURI = 'data:application/octet-stream;base64,' + btoa(response);
        $('<a></a>').attr({
            download:  'db.csv',
            href: dataURI
        })[0].click();
    });

这就是设置的完成方式:

enter image description here

所以我的问题是,当我点击一个单元格时,为什么后退按钮项目没有显示?

注意:

有趣的是,我正在使用UIPageView,其中后退按钮显示我使用与父视图控制器中相同的代码。那我错过了什么?我确信这是在以前的IOS版本上工作。升级后发生这种情况可能会对你们有所帮助吗?

谢谢

2 个答案:

答案 0 :(得分:1)

后退按钮未显示,因为在当前UINavigationController中只有单元格详细信息屏幕,因此无法返回。

我认为您应该将UIViewController放在包含UITableView

var images = ['img/1.png', 'img/2.png'], loadedImages = [], canvas,ctx, idx=0: function main() { ctx.drawImage(images[1], 0, 0); } function loadImages() { if (loadedImages.length == images.length) { main(); return; } var image = new Image(); image.onload = function() { loadedImages.push(this); loadImages(); idx++; } image.src = imageFiles[idx]; } function init() { canvas = document.getElementById('gameCanvas'); ctx = canvas.getContext('2d'); loadImages(); } window.onload = function() { init(); } 前面

答案 1 :(得分:0)

试试这个

UIButton *aBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [aBtn setImage:[UIImage imageNamed:@"YourImageName"] forState:UIControlStateNormal];
    [aBtn setFrame:CGRectMake(0, 0,50, 64)];
    [aBtn.titleLabel setFont:[UIFont systemFontOfSize:18.0]];
    aBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    aBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
    aBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);

    [aBtn setTitleColor:[UIColor colorWithRed:1/255.0 green:65/255.0 blue:96/255.0 alpha:1.0] forState:UIControlStateNormal];

        [aBtn addTarget:self action:@selector(popViewController) forControlEvents:UIControlEventTouchUpInside];

    UIBarButtonItem *aBarBtn = [[UIBarButtonItem alloc]initWithCustomView:aBtn];
    self.navigationItem.leftBarButtonItem = aBarBtn;

-(void)popViewController
{
    [self.navigationController popViewControllerAnimated:YES];
}