Apptentive Message单元格颜色变化

问题描述 投票:1回答:1

嗨我尝试自定义ApptentiveMessageCenterReplyCell,ApptentiveMessageCenterContextMessageCell,ApptentiveMessageCenterMessageCell颜色,因为它被用作Storyboard中的单元格。在颜色更改我想更新其背景颜色,我无法使用SDK从styleSheet访问它。

iOS SDK版本:apptentive-ios 4.0.7

//示例代码

ApptentiveStyleSheet *style = [[Apptentive sharedConnection]styleSheet];
style.backgroundColor = self.isLightTheme ? [UIColor whiteColor] : [UIColor blackColor];
style.primaryColor = self.isLightTheme ? [UIColor blackColor] : [UIColor whiteColor];

在iPhone X风景中改变颜色时面临问题。无法更改所提到的单元格UITableViewCell的颜色..

ios objective-c uitableview iphone-x apptentive
1个回答
1
投票

目前,在第一次启动Message Center或Surveys之后,样式表对象并不完全支持更改颜色。

但是,当您的应用主题更改时,您应该能够通过以下方式将样式表对象上的didInheritColors布尔属性设置为NO。使用键值编码。

这应该使样式表重新计算从主要颜色和背景颜色确定的各种中间颜色(您可能希望避免在显示消息中心时更改主题,因为它可能导致颜色不一致)。

另一种方法是使用-setColor:forStyle:在样式表对象上设置显式颜色覆盖,但是您必须对直接设置的颜色和从这些颜色计算的中间颜色执行此操作。

© www.soinside.com 2019 - 2024. All rights reserved.