【发布时间】:2017-06-02 10:55:14
【问题描述】:
我正在使用 Apptentive,并且我正在尝试自定义相同的消息中心。我想更改“ApptentiveColorContextBackground”颜色,但我无法弄清楚它从哪里更改 link 表示用户可以修改 UI。
任何帮助都会很棒!
已编辑:-
试过了
在 ApptentiveMessageCenterViewController.m 中
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
switch ([self.dataSource cellTypeAtIndexPath:indexPath]) {
case ATMessageCenterMessageTypeMessage:
case ATMessageCenterMessageTypeCompoundMessage:
[(ApptentiveStyleSheet *)Apptentive.shared.styleSheet setColor:[UIColor redColor] forStyle:ApptentiveColorMessageBackground];
cell.contentView.backgroundColor = [[Apptentive sharedConnection].styleSheet colorForStyle:ApptentiveColorMessageBackground];
break;
case ATMessageCenterMessageTypeReply:
case ATMessageCenterMessageTypeCompoundReply:
cell.contentView.backgroundColor = [[Apptentive sharedConnection].styleSheet colorForStyle:ApptentiveColorReplyBackground];
case ATMessageCenterMessageTypeContextMessage:
[(ApptentiveStyleSheet *)Apptentive.shared.styleSheet setColor:[UIColor redColor] forStyle:ApptentiveColorContextBackground];
cell.contentView.backgroundColor = [[Apptentive sharedConnection].styleSheet colorForStyle:ApptentiveColorContextBackground];
}
}
【问题讨论】:
-
看起来不错,但您应该将
-setColor:forStyle:调用移至-application:didFinishLaunchingWithOptions之类的名称中。 -
另外,4.0.5 之前的 SDK 版本中存在
goto fail样式的错误,导致回复单元格无法正确着色。
标签: ios message apptentive