LGSideMenuBar background color change - ios

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];

Related

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

iOS custom keyboard template background colour as image

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.

Button with first half transparent and other half title

I have some requirement to prepare a UI like Image 1:
But sometime i get it like(title disappeared)
I am not sure why this is happening.
The background image second has half transparent and half image(refresh image),there i need to show text.
EDIT
XIB settings:
Any idea or solution for this ?
OR
Please suggest some other way to achieve this.
I just found in the UIstoryboard, why don't you try in this way
You can configure this UIButton as your need with the title attributes, right ?
As per your comment => colour of the title will be configured from server.
Then may be it is also possible that sometimes you will get clearColor of your button's title from server so you not able to display title of button. For solve this issue you need to put condition such like,
if(ButtonTitleColor is "clearColor")
[myButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; // here set color whatever you want.

Set an image as background for TableView with Storyboard in iOS

Storyboard is causing to me a lot of problems! :(
Now I'm trying to put an image as a background of a tableview in iOS.
I've done a png image with transparency in photoshop and I've imported it into my project.
** The first question is: is it possible to set the image background in storyboard?
I thought that a good idea was to create and image view and put it on my table view... but storyboard doesn't allow my to do this.
** I've also tried to add the background image via code:
- (void)viewDidLoad
{
[super viewDidLoad];
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"table_background.png"]];
...
}
I obtained an horrible result with a black background instead of white, even if the png is transparent!
Moreover I've read that to optimize performances, it should be better to avoid transparent background for cells.
So, what it the best way to set an image as a background for a table view with storyboard?
Thank you in advance,
yassa
I think you have a method to set a background view for a tableView
[ tableView setBackgroundView:<#(UIView *)#> ];
And then add an UIImageView (but only for 3.2+)
Avoid using backgroundColor for this kind of things ^^
Using only story board I don't know :-] but with this method it should work.
Btw check that your tableView & cell have a clear backgroundColor, may be the problem too.
Good luck.

How to change UITabBar Selection color

I need to change the selection color of UITabBar from default blue to red. How do we do this.
Update September 2017:
It's been two years since I've written this answer and since it's receiving upvotes regularly, I should say this is probably the worst possible answer to this question, it's error prone, likely to break because of iOS updates, hard to debug, etc., so please don't do the things I've written and apply better solutions such as subclassing UITabBar or UITabBarController. Thanks.
You can do this by setting a "tintColor" attribute (Key Path) for you UITabBar.
Select the UITabBar in the document outline. (NOT the Controller with the yellow icon.)
Select Identity Inspector in the Utilities area.
Click the + in "User Defined Runtime Attributes."
Add a "tintColor" Key Path of type "Color" and the color you want.
This should do it. You can check it against the screenshot below.
More on this:
There's a "Tint" attribute in Identity Inspector of UITabBar which I believed would do the exact same thing but apparently, it does nothing. It's default value is the exact default fill color when a UITabBarItem is selected, so my guess is it would be fixed in the stable release Xcode 7. Fingers crossed.
In IOS5, UITabBar has a selectedImageTintColor property which does what you need.
In iOS 7 it's simply the tintColor. One way to accomplish this could be to subclass UITabBarViewController, set the custom class in the storyboard, and in your viewDidLoad method of the subclassed tabBarVC add this:
[[self tabBar] setTintColor:[UIColor redColor]];
To achieve above result perform following steps.
Step 1: Add your desired images in Assets.xcassets, and make sure they Render As: Default
Step 2: Select your UITabBar object and set Image Tint color, this color will be selected tab color
Step 3: Select UITabBar object and add Key Path: unselectedItemTintColor, Type: Color, Value: Choose color for unselected item in User Defined Runtime Attributes.
All done.
It is extremely easy
Create a custom class of UITabBarController and in -(void)viewDidLoad method add this line:
[[self tabBar] setSelectedImageTintColor:[UIColor greenColor]];
Because UITextAttributeTextColor is deprecated in iOS 7, you should use:
[UITabBarItem.appearance setTitleTextAttributes:#{NSForegroundColorAttributeName : [UIColor greenColor]} forState:UIControlStateNormal];
[UITabBarItem.appearance setTitleTextAttributes:#{NSForegroundColorAttributeName : [UIColor purpleColor]} forState:UIControlStateSelected];
Starting from iOS 8 it's as simple as:
UITabBar.appearance().tintColor = UIColor.redColor()
Simply change the following property in Interface Builder for the TabBar
Obviously in my case its White.
The SDK does not make this easy, but it is technically possible. Apple apparently believes this to be part of their vision of a consistent look and feel.
UITabBar is a subclass of UIView. You can always subclass and implement your own -drawRect:
This is not a trivial task, however, you have to essentially re-implement the class from scratch or you risk some weird side-effects.
Swift 5 Programatically
It is pretty easy in Swift 5.
In your TabBarController write this:
tintColor = UIColor.red
That's it
I've been searching for a way to set the selected text color of a UITabBarItem and have found a dead simple method, using the UIAppearance protocol.
[UITabBarItem.appearance setTitleTextAttributes:#{
UITextAttributeTextColor : [UIColor greenColor] } forState:UIControlStateNormal];
[UITabBarItem.appearance setTitleTextAttributes:#{
UITextAttributeTextColor : [UIColor purpleColor] } forState:UIControlStateSelected];
Please excuse the awful colors!
iOS 5.0 fixes this issue but the solution is under NDA. Look up UITabBar in your documentation for an EASY way to do what you want to do.
I found the easiest solution -
Select Tab Bar in Tab Bar Controller
Set Image Tint color
Set Tint Color
For reference see the attached image.

Resources