Ios 转换后,导航按钮将颜色更改为灰色
我可以使用“添加按钮”进行推送转换,但我还需要以编程方式进行。当我以编程方式执行此操作,然后返回时,“添加按钮”变为灰色。我对它进行了调试,可以看到_titleView中的_defaultattributes发生了变化。颜色值已更改。为什么会改变?如何预防呢?看起来很混乱Ios 转换后,导航按钮将颜色更改为灰色,ios,objective-c,Ios,Objective C,我可以使用“添加按钮”进行推送转换,但我还需要以编程方式进行。当我以编程方式执行此操作,然后返回时,“添加按钮”变为灰色。我对它进行了调试,可以看到_titleView中的_defaultattributes发生了变化。颜色值已更改。为什么会改变?如何预防呢?看起来很混乱 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { AddPalletViewCon
-(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];
}
请分享一些代码,让图片变得清晰!请分享一些代码,让图片变得清晰!没有更改…现在在视图中显示我更改了按钮的颜色。没有更改…现在在视图中显示我更改了按钮的颜色。