Apptentive Message cell color change - ios

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

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.

Related

In iOS, is there any standard mechanism for color pickers?

I'm at a loss trying to find anything relevant to this question. Basically, I'm looking to write an app that's kind of like a color picker / swatch library (but with a certain purpose in mind) and I'd like to be able to use it in virtually any app that deals with color selection. Is there any built in, or perhaps novel way, I could either modify some config variable, or send some kind of signal that updates the current color? Or I guess the real question would be, is there any concept of a global color in iOS?
Maybe you are referring to tintColor?
From Apple guidelines:
Using Tint Color
In iOS 7, tint color is a property of UIView. iOS 7 apps often use a
tint to define a key color that indicates interactivity and selection
state for UI elements throughout the app.
When you specify a tint for a view, the tint is automatically
propagated to all subviews in the view’s hierarchy. Because UIWindow
inherits from UIView, you can specify a tint color for the entire app
by setting the window’s tint property using code like this:
window.tintColor = [UIColor purpleColor];
From Apple docs:
The first nondefault tint color value in the view’s hierarchy,
ascending from and starting with the view itself.
I hope that helps.

How can i change the color of the predefined buttons in apple research kit

I am trying to make a survey using Apple's ResearchKit but I couldn't find how to change the color of the predefined buttons. They are blue but I want to make them of a different color. How to do this?
Using UIView's appearance proxy to set the tint color should work:
[UIView appearance].tintColor = yourColor;
It's very late now but might save somebody's time, worked for me:
taskviewcontrollerobject.view.tintColor = [UIColor redColor]; // color of your choice

Change Anypic Assets

When changing the assets in the Parse Anypic tutorial it doesn't show up in the actual simulator. The files I changed are in the Resources folder: Default.png, Default#2x.png, Default-568h#2x.png, Default-667h#2x.png, Default-736h#2x.png
For more clarification this is a picture of the files I changed.
https://www.dropbox.com/s/cjml6hs2aur9z96/Screenshot%202015-04-21%2017.09.13.png?dl=0
Question: How can I change the black "Home" screen - not the LaunchImage but the actual interaction. I want to re-skin the app.
For clarity, I'm referring to the first screen you see after logging into Facebook. This screen has three tabs at the bottom, "Home", "Camera", and "Activity". The "Home" view is controlled by PAPHomeViewController.m, and the "Activity" view is controlled by PAPActivityFeedViewController.m.
In both of these controller classes, the main background is covered by a table view and there is also a blankTimelineView that can be shown as the table view header.
To update the background, you can have a couple of options. Option 1 is to change the view behind the table view and make the table view transparent. Option 2 is to change the background on the table view itself.
In both cases, you may also want to make the blankTimelineView background transparent so the background always shows through.
If you go with Option 1, the following code can be placed at the bottom of the viewDidLoad method in PAPHomeViewController.m and in PAPActivityFeedViewController.m
// For simple change, set background color
// To show an image, add an UIImageView as a subview
self.view.backgroundColor = [UIColor redColor];
// Make sure background shows through
self.blankTimelineView.backgroundColor = [UIColor clearColor];
self.tableView.backgroundView.backgroundColor = [UIColor clearColor];
If you go with Option 2, you can use the following code at the bottom of the viewDidLoad method in PAPHomeViewController.m and in PAPActivityFeedViewController.m
// For simple change, set background color
// To show an image, set backgroundView to a UIImageView
self.tableView.backgroundView.backgroundColor = [UIColor redColor];
// Make sure background shows through
self.blankTimelineView.backgroundColor = [UIColor clearColor];
If you aren't getting the assets changed maybe run it on an actual phone. Check to see if the assets show up or not based on your result choose between starting over and importing all your code or retrieve the assets from another project and import it to your old project

Change Tint/Background colour of iOS controls without using images

Is it possible using the UIAppearance proxy (in iOS 5) to change the background colour of iOS Elements, specifically the tab bars and title bars without using images?
I'd like to use a deep green gradient, but without using images. Is it possible to do so in both iOS 5 and below?
Well you're asking two different questions here, but if you want to simply change the tint color it can be done like this...
self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:255 green:0 blue:0 alpha:1];
self.tabBarController.tabBar.tintColor = [UIColor colorWithRed:255 green:0 blue:0 alpha:1];
Additionally, if you wish to use a gradient this is possible to do without imagery, but is best done with a tiled image...
self.navigationController.navigationBar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"myGradient.png"]];
self.tabBarController.tabBar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"myGradient.png"]];
Heh, now in iOS6 you can now add UIStatusBarTintParameters key to Info.plist.
From the iOS6 GM changelog:
It is now possible to set status bar tint parameters in your app's Info.plist file. You might do this to ensure that the status bar color matches your app’s navigation bar color during startup. To set the status bar tint, add the UIStatusBarTintParameters key to your Info.plist file. The value of this key is a dictionary with the appropriate values describing the navigation bar your app has at startup. Inside the dictionary should be the UINavigationBar key, which has a value that is also a dictionary. That dictionary contains the initial navigation bar’s style (with the Style key) and indicates whether it is translucent (with theTranslucent key). You can also specify your navigation bar’s tint color (with the TintColor key) or the name of its custom background image (with the BackgroundImage key).

Some UI elements don't acquire UIAppearance traits

I am trying to use UIAppearance to get a uniform color theme in my iOS app. For example I try to set the text color of all UILabel objects as follows:
[[UILabel appearance] setTextColor:[UIColor colorWithRed:0.7 green:0.07 blue:0.12 alpha:1]];
This works fine for all objects statically defined in my storyboard/XIBs. However, sometimes I need to dynamically create a UILabel in a view. In these cases, the UIAppearance is not used. Instead the default text color (black) is used instead.
Has anyone run into this issue/ found a way around it other than resorting to the old "set every element manually" approach?
Seems that not all the classes support UIAppearance and UILabel is not one of those.
Check this question for more info:
UIAppearance not taking effect on UILabels created programatically
Here's a list of classes that support UIAppearance:
http://blog.mosheberman.com/list-of-classes-that-support-uiappearance-in-ios-5/

Resources