简体   繁体   English

Apptentive Message 单元格颜色更改

[英]Apptentive Message cell color change

Hi I tried to customize apptentive ApptentiveMessageCenterReplyCell , ApptentiveMessageCenterContextMessageCell , ApptentiveMessageCenterMessageCell color since it is being used as cell in Storyboard.嗨,我尝试自定义 apptentive ApptentiveMessageCenterReplyCellApptentiveMessageCenterContextMessageCellApptentiveMessageCenterMessageCell颜色,因为它被用作 Storyboard 中的单元格。 On color change i want to update its background color for that i could not access it from styleSheet using SDK.在颜色更改时,我想更新它的背景颜色,因为我无法使用 SDK 从 styleSheet 访问它。

iOS SDK version: apptentive-ios 4.0.7 iOS SDK 版本:apptentive-ios 4.0.7

//Example code //示例代码

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

Facing issue in while changing color in iPhone X landscape.在 iPhone X 横向更改颜色时遇到问题。 Could not able to change color for mentioned cells UITableViewCell..无法更改提到的单元格 UITableViewCell 的颜色..

Currently the stylesheet object doesn't fully support changing colors after Message Center or Surveys have launched for the first time.当前,样式表对象不完全支持在首次启动消息中心或调查后更改颜色。

However, when your app's theme changes, you should be able to set the didInheritColors boolean property to NO on the stylesheet object by eg using key-value coding.但是,当您的应用程序的主题更改时,您应该能够通过例如使用键值编码将样式表对象上的didInheritColors布尔属性设置为NO

This should cause the stylesheet to re-calculate the various intermediate colors that are determined from the primary and background colors (you'll probably want to avoid changing the theme while Message Center is being displayed, as it could cause inconsistent colors).这应该会导致样式表重新计算由主要颜色和背景颜色确定的各种中间颜色(您可能希望避免在显示消息中心时更改主题,因为它可能导致颜色不一致)。

Another approach is to set an explicit color override on the stylesheet object using -setColor:forStyle: , but you would have to do this for both the directly-set colors and the intermediate ones that are calculated from those.另一种方法是使用-setColor:forStyle:在样式表对象上设置显式颜色覆盖,但您必须为直接设置的颜色和根据这些颜色计算的中间颜色执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM