weird background in grouped table cell - iphone

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.

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.

DACircularProgress in iPhone 5

I am using this open source (https://github.com/danielamitay/DACircularProgress) with the following
self.largestProgressView.trackTintColor = [UIColor redColor];
self.largestProgressView.progressTintColor = [UIColor whiteColor];
self.largestProgressView.thicknessRatio = 1.0f;
It works fine on all devices apart from iPhone 5. On iPhone 5 it shows a semi circle shifted to the right of the uiview. Any ideas how I can fix this?
I managed to resolve the issue. All I had to do was add Height Constraint for the view.

How to view previous screen in current viewcontroller background in 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.

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.

Create UILabel background similar to selected UITableViewCell

I want to create a UILabel and set its background to the gradient-blue like a selected UITableViewCell. I suspect I need to use UIColor colorWithPatternImage:. If yes, I am not sure what the best way to get the pattern image is. Or, any other suggestions on how to accomplish this?
I would prefer not to create a pre-rendered background image since I need this to work on iPhone 3GS, 4 and iPad which all will require different background images.
The image used by Apple is UITableSelection.png. I have attached the standard and #2x images.
UIView *selectedView = [[UIView alloc] initWithFrame:self.bounds];
selectedView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"UITableSelection.png"]];
cell.selectedBackgroundView = selectedView;
Cool post here on customising cell appearance...
http://www.raywenderlich.com/2033/core-graphics-101-lines-rectangles-and-gradients
It's an undocumented color, I'm not sure if you'd want to use an undocumented color. But it's called
[UIColor tableSelectionColor]
Also, it doesn't have the gradient effects that you want. I assume it's a gradient overlay applied to the cell? I don't know how apple does it, but if you wanted to know the color, that's what it is. the RGB values are 0.16, 0.43, 0.83 respectively.
Your_label_name.backgroundColor = [UIColor colorWithRed:72.0/255.0 green:118.0/255.0 blue:255.0/255.0 alpha:1.0];
also refer this link :
http://cloford.com/resources/colours/500col.htm