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.
Related
I have designed a xib whose configuration I have set as shown in the pic
I have added a UIImageView to the xib view and added proper constraints
So that the UIImageView appears full screen but the problem is that this works good for iPhone 5 but fails to scale on iPhone 6, I am not understanding the problem.
The UIImageView Configurations are as in the pic
To fill the UIImageView full screen, set the mode to Scale to fill. If it does not fill screen yet, then the size of image is not appropriate. i would recommend you to use vector graphics.
I was making a silly mistake while adding the UIView as subview I was not describing the frame
Describing the frame as,
[self.profileView setFrame:CGRectMake(0, 0, Get_Bounds.width, Get_Bounds.height - 64)];
This does the trick.
I can successfully take a photo and set it to the background image for a button. The problem is that the image gets smushed. Should I be setting a crop on it or what am I missing for this to render the image correctly. Thanks.
After properly using constraints in the IB, the image then set to the button in a normal format. I found out that having dotted lines on the view controller due to constraints is a bad thing. After doing constraints the right way, the image showed perfectly. Thanks all for the help.
I want to remove the horizontal separator line between a UITabBar and the rest of the screen. I'm asking the same question as this guy but updated for iOS7.
Setting the background image of my UITabBar doesn't alleviate the problem, nor does setting the background image of the [UITabBar appearance] object.
Is this still possible in iOS7? If so, how?
You could also hide shadow line using this code:
[self.tabBar setValue:#(YES) forKeyPath:#"_hidesShadow"];
Swift
self.tabBar.setValue(true, forKey: "_hidesShadow")
The answer to this is pretty much the same as removing the separator of a navigation bar or a toolbar.
Officially, this is only possible by setting the shadowImage to an empty image. However, a closer look at the documentation, we see that:
For a custom shadow image to be shown, a custom background image must
also be set using the backgroundImage property. If the default
background image is used, then the default shadow image will be used
regardless of the value of this property.
By using a custom background image, you would lose the blurred background translucency.
The separator is a UIImageView that is a subview of the tab bar. You can find it in the tab bar's hierarchy and set it to hidden.
This solution uses a transparent image, so it is more preferable.
Swift
tabBar.shadowImage = UIImage()
Objective-C
tabBar.shadowImage = UIImage.new;
How to create a gray overlay view on a UIButton that contain an image, but to make the overlay to be shown only on the image itself, not on the whole button so just the image will be gray color.
Is it possible?
This is the button as it is:
This is with overlay:
This is how I want it to be:
Thanks!
Just set the image you want for the highlighted state. You can do this in a XIB or on your storyboard by setting the state to "Highlighted":
and then setting the image:
OR
Do it through code like this:
[theButton setImage:theImage forState:UIControlStateHighlighted];
The image can be quickly duplicated and converted to black-and-white with Photoshop or GIMP, etc. Changing the image to black-and-white programmatically is way more work than it's worth.
I am using interface builder to create my create my .nib file. THe first thing I did was to add an UIImage view to cover the screen with a background image that serves as part of the interface graphic. Everything was working fine, now the image is shifted up slightly in the simulator. THe Status, Top, and Bottom bar are all "Unspecified". Has anyone encountered this issue and found a way to resolve it?
Is the size of your view in the nib the same size as it will be in the simulator? If it's smaller, your autoresizing masks may be centering it vertically. Verify that it's the correct size, and then verify the autoresizing masks in IB are set the way you want them to be.