问题
Hi I tried to customize apptentive ApptentiveMessageCenterReplyCell, ApptentiveMessageCenterContextMessageCell, ApptentiveMessageCenterMessageCell color since it is being used as cell in Storyboard. On color change i want to update its background color for that i could not access it from styleSheet using SDK.
iOS SDK version: 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. Could not able to change color for mentioned cells UITableViewCell..
回答1:
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 e.g. using key-value coding.
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.
来源:https://stackoverflow.com/questions/47032316/apptentive-message-cell-color-change