UItextview Transparent Color IOS - ios5

I want to set my UItextview s color transparent but not completely transparent. I want little bit gray or black at the background exactly like the picture
I am using this code right now
_textView.backgroundColor = [UIColor clearColor];
how can I make it transparent like in the picture above? Any example Code?

You should use something like this:
_textView.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.5];
where alpha - parameter for transparent ( 50% in example).

Does this do what you want? (You may need to experiment with the values).
_textView.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.5];

Related

iphone - how do I make my label look like iPhone's inbuilt ones?

I want to create custom labels using UILabel that look like the ones iPhone settings have. Something similar to
How do I create the shadow effect and what font could I use?
You can set the shadowOffset to your UILabel. the first parameter is for horizontal shadow and second parameter for vertical shadow(as you are showing white shadow in your image).
label.shadowColor = [UIColor whiteColor];
label.shadowOffset = CGSizeMake(0.0, 1.0);
[label setFont:[UIFont fontWithName:#"Helvetica" size:12]];

uiview with uiimage as background

u build an UIView and put an image as the view backgrond:
self.tmpView = [[UIView alloc] initWithFrame:CGRectMake(20, 70, 280, 295)];
self.tmpView.backgroundColor = [UIColor yellowColor];
self.tmpView.backgroundColor = [UIColor clearColor];
self.tmpView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"CloseUPPicBG.png"]];
the problem is that theuiview is now with corners in black color.
the image that i put as backgrond is with rounded corners.
any solution for this?
Edit the image to not have rounded corners, or so that the space behind the corners is some other color or image.
What you're doing is saying
View, be yellow.
View, be clear. What's behind you? Nothing. Ok, be black.
View, fill yourself with this image.
View is then thinking
Hmm... there's transparency in this image.
Guess I should show whatever's behind me. Which is nothing... So black.
self.tmpView.opaque = NO;
might help.

how to change the color/style of the toolbar that comes with the UInavigationBar?

I want to change the colour of the toolbar to Black from the default blue. How do I do that ? Thanks.
You need to set the barStyle on the UINavigationBar to UIBarStyleBlack:
navigationController.navigationBar.barStyle = UIBarStyleBlack;
If you need to set it to some other color, you will need to set the tintColor property:
navigationController.navigationBar.tintColor = [UIColor blackColor];
You can read this question if you interested in the benefits of UIBarStyleBlack over a [UIColor blackColor] tintColor.
Use the below code. You can change the color of navigationbar what ever you want. Here I'm using brown , instead of this you can specify another color.
self.navigationController.navigationBar.tintColor = [UIColor brownColor];
I believe you're looking for setTintColor

Clear Background color on UIImageView?

hello i have a UIimageView with a PNG image that has round corners, image sits fine the only problem it has is that i can see the UIImage Corners with a white background, how can I make the background clear and transparent.
Try this:
imageView.backgroundColor = [UIColor clearColor];
imageView.opaque = NO;
You can achieve the same thing in IB by making the 'Background' a color with 0% opacity, and unticking the 'Opaque' checkbox.
try
imageView.backgroundColor = [UIColor clearColor];

How to programmatically change UIColor of view

Okay, this question comes through a friend so it might be lost in translation...
Basically we need to change the color on a View. It appears to be stored in NSString format, but using a NSString to set the UIColor doesn't seem to do anything. In other words, if NSString color holds the value "redColor" then:
self.view.backgroundColor = color; //does nothing
Disclaimer: we are Objective-C/iPhone newbies.
Try
self.view.backgroundColor = [UIColor redColor];
You can also give RGB values like
self.view.backgroundColor = [UIColor colorWithRed:200/255.0 green:0/255.0 blue:67/255.0 alpha:1.0];
All the Best.
The color must be a UIColor object:
self.view.backgroundColor = [UIColor redColor];
like this also we can use
[self.view setBackgroundColor:[UIColor redColor]];
self.view.backgroundColor = [UIColor blueColor];
OR do like this
self.view.backgroundColor = [UIColor colorWithRed:180.0/256.0 green:180.0/256.0 blue:180.0/256.0 alpha:1.0];
The simplest way to add color programmatically is by using ColorLiteral.
Just add the property ColorLiteral as shown in the example, Xcode will prompt you with a whole list of colors which you can choose. The advantage of doing so is lesser code, add HEX values or RGB. You will also get the recently used colors from the storyboard.
Example:
self.view.backgroundColor = ColorLiteral