iOS custom keyboard template background colour as image - ios

I want to change the custom keyboard template background colour.The default colour is grey. am trying to supply an image for its background but it is still showing grey.Below is the code I tried
self.view.opaque = YES;
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"bg"]];
But the same background colour changes when I did like below code
self.view.opaque = YES;
self.view.backgroundColor = [UIColor blackColor];
And similarly the same issue when I pass UIImages to UIButton's current image inside the keyboard template.Where am I going wrong?

I will answer my own question.Found the answer here.Thanks to honcheng.
You probably didn't add the image to your keyboard target.
Check your keyboard target > Build Phases > Copy bundle resources to make sure that the image is there. Drag it there if it isn't.Note that I am talking about the keyboard target, not the host app. That could be the confusion here.

Related

Apptentive Message cell color change

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.

LGSideMenuBar background color change

I am using LGSideMenuController in my project, i have changed the color of cells in my table view but unable to change the remaining view color. If anyone is familiar with LGSideMenuController plz help.
See image for ref.
remove image and Add UIcolor of background:
add below line in MainViewController in LGsidemenu file:
self.leftViewBackgroundColor =[UIColor grayColor];

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

Resources