注释消息单元格颜色更改 [英] Apptentive Message cell color change

查看:89
本文介绍了注释消息单元格颜色更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试自定义贴心 ApptentiveMessageCenterReplyCell ApptentiveMessageCenterContextMessageCell ApptentiveMessageCenterMessageCell 颜色,因为它已在情节提要中用作单元格.关于颜色更改,我想更新其背景颜色,因为我无法使用SDK从styleSheet中访问它.

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版本:apptentive-ios 4.0.7

iOS SDK version: 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的颜色.

Facing issue in while changing color in iPhone X landscape. Could not able to change color for mentioned cells UITableViewCell..

推荐答案

当前,在首次启动Message Center或Surveys之后,样式表对象不完全支持更改颜色.

Currently the stylesheet object doesn't fully support changing colors after Message Center or Surveys have launched for the first time.

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

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).

另一种方法是使用-setColor:forStyle:在样式表对象上设置显式颜色替代,但是您必须对直接设置的颜色和从中计算出的中间颜色都进行此设置.

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.

这篇关于注释消息单元格颜色更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆