Change background color/image of TTThumbsViewController - iphone

can I change the background image of my TTThumbsViewController. It's the thumbnail overview screen and at the moment it is white. Can I turn it to transparent?
Thx :-)

(void)viewDidLoad {
self.tableView.backgroundColor = [UIColor blackColor];
}

Related

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.

UILabel background color

I am trying to change the UILabel background color with this code
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
m_ShopName.text = m_CurrShop.m_Name;
m_ShopAddress.layer.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0].CGColor;
}
but nothing is happening.
This will help you
UILable *lbl = [[UILabel alloc]initWithFrame:CGRectMake(10,20,50,200)];
lbl.backgroundColor = [UIColor redColor];
Can you do this:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
m_ShopName.text = m_CurrShop.m_Name;
m_ShopAddress.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0];
}
I always did the following
m_ShopAddress.backgroundColor = [UIColor red];
When I wanted to change the alpha...
m_ShopAddress.alpha = 0.0f;
An alpha value of 0 means, it's fully transparent. That's probably why nothings happens (whatever you mean by that).
And I wouldn't access the background color of the layer, but of the UILabel directly.
If you are using a storyboard, check to see if you have a color for the view background in the storyboard. The view background color was overriding the layer color for me. I changed the background color for the view in the storyboard to default and this fixed it for me.
So I had the code:
func select() -> Void {
imageViewBackgroundView.layer.backgroundColor = UIColor.black.cgColor
cellImageView.layer.backgroundColor = UIColor.black.cgColor
cellLabel.layer.backgroundColor = UIColor.black.cgColor
cellLabel.textColor = UIColor.white
}
The cellLabel was the view background that was not changing. I had at one time set a background color for the view in the Storyboard. Once I changed the view background for the cellLabel to default the layer color took effect.
View Background

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

iPhone Subview Transparent

I subclassed a subview and added it to the current view. It draws a simple circle by overriding the draw method.
But the subview has a black background it looks like by default. How do I make the background of my subclassed subview to be transparent?
does
self.backgroundColor = [UIColor clearColor] not work?
You can call next code into view initialization:
self.backgroundColor = [UIColor clearColor];

using image or tint color on uinavigationbar in iphone?

how do i show a background image on a navigation bar or give tint color to the navigation bar in a native iphone application??
For iOS5 use the following lines of code:
UINavigationBar *navBar = [[self navigationController] navigationBar];
UIImage *backgroundImage = [UIImage imageNamed:#"nav-bar-background-normal"];
[navBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault];
For backward compatibility do a check to see if the navigation bar responds to setBackgroundImage:forBarMetrics:
More information on:
http://sebastiancelis.com/2009/12/21/adding-background-image-uinavigationbar/
This's how I did on iOS4:
#import <QuartzCore/QuartzCore.h> // For .layer
self.navigationController.navigationBar.layer.contents = (id)[UIImage imageNamed:#"navigationBarBackgroundImage"].CGImage;
self.navigationController.navigationBar.tintColor = [UIColor orangeColor];
No need to switch subviews between z-orders (-exchangeSubviewAtIndex:withSubviewAtIndex:), both background image and tintColor set in one line of code, and works with #2x image too.
Was looking for this a week ago. Found this over here discussions. apple. com/thread.jspa?threadID=1649012&tstart=0 (sorry won't let me post a real link).
-(void)setBackgroundImage:(UIImage*)image withTag:(NSInteger)bgTag{
if(image == NULL){ //might be called with NULL argument
return;
}
UIImageView *aTabBarBackground = [[UIImageView alloc]initWithImage:image];
aTabBarBackground.frame = CGRectMake(0,0,self.frame.size.width,self.frame.size.height);
aTabBarBackground.tag = bgTag;
[self addSubview:aTabBarBackground];
[self sendSubviewToBack:aTabBarBackground];
[aTabBarBackground release];
}
/* input: The tag you chose to identify the view */
-(void)resetBackground:(NSInteger)bgTag {
[self sendSubviewToBack:[self viewWithTag:bgTag]];
}
I made this as a category to UINavigationBar. To set it a background image for a UINavigationBar inside a UINavigationBarController, I did this:
[navigationControllerForChannels.navigationBar setBackgroundImage:[UIImage imageNamed:#"top_bar.png"] withTag:48151623];
I've had some buginess when updating the tab bar, so you'll want to call
[self.navigationController.navigationBar resetBackground:48151623];
After any modifications to the bar.
You can override UINavigationBar drawRect. The code can be placed to appDelegate.m
I've tested it and it's working on 3x and 4x iOS.
#implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect {
UIColor *color = [UIColor blackColor]; //tint color
UIImage *img = [UIImage imageNamed: #"navBarBg.png"]; // your image
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
self.tintColor = color;
}#end
For the iOS5 and iOS6 I've used this solutions and it worked perfectly, Making a Universal UINavigationBar Background Image.
iPhone Retina Portrait 640px x 88px / iPhone Non-Retina Portrait 320px x 44px
Inside AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Place this code
// Set the status bar to black color.
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:NO];
// Change #"menubar.png" to the file name of your image.
UIImage *navBar = [UIImage imageNamed:#"menubar.png"];
[[UINavigationBar appearance] setBackgroundImage:navBar forBarMetrics:UIBarMetricsDefault];
Don't forget to change the image name (menubar.png)
Check out this link for the full answer http://www.lwxted.com/blog/2012/add-custom-background-image-uinavigationbar-ios-5/
a background image is going to take a bit more work (you might want to try setting a titleView that's the same size as the bar itself; I haven't tried this myself) or adding a view behind existing subviews. Tint color is easy: navBar.tintColor = [UIColor orangeColor];
If you use the CGImage solution, you may have a problem with image size:
CGRect layer=self.navigationController.navigationBar.frame;
layer.size.height=57.0;
layer.origin.y=0;
self.navigationController.navigationBar.frame=layer;
CGImageRef imageRef = [UIImage imageNamed:#"myImg.png"].CGImage;
self.navigationController.navigationBar.layer.contents = (id)imageRef;
It seems to me that the image is streched down, since the layer seems to have a height of 44.0 pixel, but a background image for the UINavigationBar should be at least 57.0.
If you try to move the layer's frame, all the buttons will move within it.