Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 转换后,导航按钮将颜色更改为灰色_Ios_Objective C - Fatal编程技术网

Ios 转换后,导航按钮将颜色更改为灰色

Ios 转换后,导航按钮将颜色更改为灰色,ios,objective-c,Ios,Objective C,我可以使用“添加按钮”进行推送转换,但我还需要以编程方式进行。当我以编程方式执行此操作,然后返回时,“添加按钮”变为灰色。我对它进行了调试,可以看到_titleView中的_defaultattributes发生了变化。颜色值已更改。为什么会改变?如何预防呢?看起来很混乱 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { AddPalletViewCon

我可以使用“添加按钮”进行推送转换,但我还需要以编程方式进行。当我以编程方式执行此操作,然后返回时,“添加按钮”变为灰色。我对它进行了调试,可以看到_titleView中的_defaultattributes发生了变化。颜色值已更改。为什么会改变?如何预防呢?看起来很混乱

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    AddPalletViewController * addPalletViewController = [self addPalletViewControllerInstance];
    [addPalletViewController setEditMode:true];
    [addPalletViewController setEditModeRowValue: [[self.datasource objectAtIndex: indexPath.section] objectAtIndex: [[[self.sectionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row+1]intValue]]];
    [[self navigationController] pushViewController: addPalletViewController animated:YES];
}

将此代码而不是您的代码放入

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
AddPalletViewController * addPalletViewController = [self addPalletViewControllerInstance];
[addPalletViewController setEditMode:true];
[addPalletViewController setEditModeRowValue: [[self.datasource objectAtIndex: indexPath.section] objectAtIndex: [[[self.sectionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row+1]intValue]]];
[[self navigationController] pushViewController: addPalletViewController animated:YES];
//Will deselect your row...
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

将此代码而不是您的代码放入

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
AddPalletViewController * addPalletViewController = [self addPalletViewControllerInstance];
[addPalletViewController setEditMode:true];
[addPalletViewController setEditModeRowValue: [[self.datasource objectAtIndex: indexPath.section] objectAtIndex: [[[self.sectionArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row+1]intValue]]];
[[self navigationController] pushViewController: addPalletViewController animated:YES];
//Will deselect your row...
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

请分享一些代码,让图片变得清晰!请分享一些代码,让图片变得清晰!没有更改…现在在视图中显示我更改了按钮的颜色。没有更改…现在在视图中显示我更改了按钮的颜色。