How to view previous screen in current viewcontroller background in iphone? - iphone

im new to iphone, i have two view controllers one is homepage and other is Flipscreen and its work in good, but i want when i navigate flipscreen, the background is just like a mirror?
how? please any one help me..
I tried the code:
self.view.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:1.0];

Like a mirror in the sense? If you need a clear back ground, try self.view.backgroundColor = [UIColor clearColor];. Try to post your questions clear.

Related

setRightView for UISearchBar not working in iOS 7

I am adding a button in searchbar on right side by this code
[searchtextfield setRightView:customButton];
[searchtextfield setRightViewMode:UITextFieldViewModeAlways];
It works upto iOS 6,but in iOS 7 i can not see it. Any idea how to accomplish it in iOS 7.
If you have white background then may be its the issue that you can't see search bar, I faced same problem but managed to solve this by adding this code by setting table view background.
UIView *backgroundView = [[UIView alloc] initWithFrame:self.tableView.bounds];
backgroundView.backgroundColor = [UIColor clearColor];
self.tableView.backgroundView = backgroundView;
Hope it'll help. Thanks.

Changing between 3 pictures in the UIImageView

Hey, I was wondering how I could make the user being able to change the background of the app? I have 3 Images that the user will be able to choose from. I've seen it in many apps. How would I do this? If possible please provide some code! :)
Thank you in advance!
It's quite easy. All you need is to set the background property of your view to an image. Here's how it's done:
self.view.backgroundColor = [UIColor colorWithPatternImage:
[UIImage imageNamed:#"yourimage.png"]];
Now, when the user selects a different image, simply repeat the above code with a different image each time.
The question should be more clear.
You can change the background of the UIView or parent UIWindow by using,
view/window.backgroundColor = [UIColor colorWithPatternImage: image]
or Use the UIImageView,
imageView.image = image

How can I make a variable background image in my iOS APP

I am making an iPhone app, and I want know how make a variable background image a background that the user can choose one of the options ?
I don't know what you want in the foreground, but anything based on the UIView class has a backgroundColor property that you can set to an image like this:
yourView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"YourImage.png"]];
It didn't work for me, what it worked was:
self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:#"background.png"]];
I think is the same, but don't know why the other answer didn't work for me.
Hope it helps.

Problem with a Retina Display Image

I have a TabBarController app where the first tabBarItem is a NavigationController...
I assign programmatically an image background to the navController with this code:self.navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"OverviewBg.png"]];
The "OverviewBg.png" image is the exact size of the view between tabBar and NavBar.
If I try my app in the iPhone 4 simulator, the high definition image isn't loaded correctly and is showed the normal image...
How can I solve this mistake? The best way to use colorWithPatternImage method is use an image with the exact size of the view or a pattern image?
Thanks
I solved this problem using initWithPatternImage method of UIColor class.
I created and allocated an UIColor instance, I assigned to it an image and then I used it with background.
UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:#"OverviewBg.png"]];
self.navigationController.view.backgroundColor = background;
Hope this can help other :)

weird background in grouped table cell

We use in our application cells in a grouped tableview as buttons. Therefore we set a backgroundimage to look the cells like buttons. We used the following code:
cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"bg_gradient_mainmenu_2.png"]];
cell.textLabel.textColor = [UIColor whiteColor];
cell.textLabel.highlightedTextColor = [UIColor whiteColor];
which looks like this
The weird thing now is that it works for just some devices with different OS Systems. It definitly doesn't work on new iPhones 4.
Does anyone has a clue how solve that problem?
for iphone 4 you can set the backgroundView.
The group table behaves erratically while working with table cell background.