I want a background image on my grouped UITableView, so I used the code:
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"imageName.png"]];
But the image is pixelated. I think I want to change the content mode, but since it is not a UIImageView... I can't seem to do it.
Is there another way to make a background image for a UITableViewController out of a UIImageView?
I created a project Patterns that you can download and plug your two images into - it correctly grabs the retina image for retina iPhone simulator, and the normal one for normal device. Plug your wood image into it and see if it works. Assuming it does not then something is wrong with your images - post them on dropbox.
If it does work, then there is something you are doing in your project that's not right - you forgot to include the retina image in the target etc.
Related
I have an UISegmentedControl with 100x42 bounds. I've set up three segments with 26x26 images and 4x42 divider images. The three segment images should fit in the segments, but they are scaled and for the worse they seem to fit vertically and are only scaled down horizontally, thus loosing proportions.
This problem appeared after i changed to Xcode 5 and iOS 7 SDK. Before that the segment images were displayed with correct proportions and in original size.
I'm not using interface builder. I've tried to set the segment sizes manually and setting the segmented control's contentMode to UIViewContentModeScaleAspectFill without help.
Is there any way to force the UISegmentedControl to simply render the images as they are?
You may set auto layout constraints to correctly define UISegmentedControl frame. Like this
I know this is a late answer but I have the same issue testing an app for IOS 7.1.
If you set the image in the code it's working properly. Example:
- (void)viewDidLoad {
[super viewDidLoad];
[_segmentedControl setImage:[UIImage imageNamed:#"779-users-toolbar"] forSegmentAtIndex:0];
}
In my project I have the normal image, and the #2x & #3x versions of the image.
I tested the code in 7.1, xcode 6.1.
When I run it in 8.1 the image set via IB works properly as well, so this may be a bug in 7.1 that has been fixed in 8.
I'm using IcoMoon to create a custom font that I use to generate Icons. This however plays no role as the same phenomenon occurs using Helvetica.
Why do 2 things occur on titleLabel of a UIButton on iOS 7?
The right edge of the label is cut off (the button frame is much wider, but the label frame is getting cut off
there is a dark ring around the light gray image.
This looks absolutely horrible and it's basically unacceptable. We'll have to render graphics ourselves and localize images where appropriate.
I would be grateful for any info. The only thing that distinguishes these two checkmarks is that they have different colors set for titleColor
Try setBackgroundImage: instead of setImage:
I have settings View which is a View Object under self.view.
I added the background image as: self.settingsView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"settings_bg__650x740.png"]];
The problem is, it is having extra images at the bottom. This only happens in iOS 7.
Here's the screenshot:
Please, help me to solve.
The image is being tiled. Why are you creating a tiled image and using it as a background color? Just put the image in a UIImageView and add the image view to the view.
try resize your image before adding to background.
You can find answer in here
Stretching a image in iOS using colorWithPatternImage
the settings view's bound size is higher than the background color referred image. so, the image will tile to fill the settings view.
I have an image with irregular shape. I set it as a background image of an UIButton.
Now, I use OBShapedButton library to enable touch only where image is non-transparent. But, for some reason if I click on transparent image area, when view appears in screen, then it responds to click, whereas it should not.
I made some area of image transparent using adobe cs4 photoshop. Now, I want to try making it transparent in xcode only. May be it helps.
To have an idea of image shape I am attaching a sample image.
Does anyone know how to do that?
I'm trying to load a large version of an image in the centre of the user's screen when then tap on a smaller version of the image that's already on my view.
Ideally I want to do this using an animation to get to the new image like a vertical flip.
Also if there's a way to make the background look greyed out like it's not the foreground then that would be even better.
Here's an image of what I'm after, I'm at work at the moment so haven't got access to the actual code / images.
I'm a new user so can't add pictures. Click here if you want to see what I'm thinking.
Image
There is an KGmodal Example Exist in GitHUB hope that Might Help you.
You have to Change the content view and Add an Imageview Programatically (with required size ) in the content View.
Follow the below link: https://github.com/kgn/KGModal
For Fliping the image see the tutorial iphone Flip Image.
In the end I added the larger image on to begin with and set its alpha to 0, then added a gesture recognizer on the smaller image that animated the larger one and gradually changed its alpha to 1. The did the reverse on the large image. Don't know why I didn't think of that in the first place!