How to create Semi-transparent buttons - ios

If anyone could show me how to make a button similar to the one in the image below I would be really grateful!! I intend to use the button in XCode for Iphone/ IPad

I have no experience of this, but did you tried to make a e.g. 50% transparent (.GIF / .BMP) picture and set it as a background of the button?

OK so I solved this now, I set the alpha of my image to 0.7 with the following code
shootButton.alpha = 0.7;
And I also used photoshop's "Satin" effect to give it a more translucent effect.

Related

iOS: Launch image gets wrinkled in the center during a call/recording/hot-spot session

I use a set of launch images for my app and noticed that when I'm having a call, recording a voice note or sharing my Internet connection and put that activity in the background and launch my app, the launch screen is wrinkled in the center. Is there anything I can do to make the image look ok or is it just a standard iOS behavior?
Just define a key in plist file will solve your problem
Status bar is initially hidden = YES
OK, the solution I found is to hide status when launching the app, just like here
Seems like Apple "take" 4% of screen space from the middle of the screen (as far as I tested) to give it to status bar. Personally I faced this problem when using iPhone modem mode.
So if it is not critical for image to be centered vertically - the solution would be to place image above/below this "4% middle screen area".
Examples when image is cropped:
How image should look(image centered vertically & horizontally, width & height are fixed size)
How it actually looks
Example when image looks as supposed to (but not centered) :
Constraints example
Image with new constraints example

Can I detect iOS' "darken colors" setting?

I noticed that my app doesn't look good when the "darken colors" iOS system setting is enabled. Some navigation buttons are white, some are darkened to gray.
Is there any way to detect if this setting is enabled?
Turns out it's quite easy to detect. Suppose the navigationBar is configured with a white tintColor. Just reading navigationBar.tintColor returns the adjusted color, in this case 80% white. We can use this color to set the navigationBar.titleTextAttributes.
For all tintable elements such as UIBarButtonItems, make sure to use template images only:
-[UIImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]

iOS app that change whole app color theme (background, uibutton, icons color...) base on user selection

I have a requirement to make application that has color theme base on user selection
User selects an color at begining (in 8 available colors), that color will be applied for the whole app (background color, buttons, icons ....)
If I create images for each color, the app will have lots of images and can be heavy in size, and that approach not seem to be good one.
I tried to import images with 1 color and then change images color according to user-selected color, but got problem with some controls like slider, and also the image that is changed does not look good as photoshop one
Would u plz help me with good approach for this?
Make all the images one color (black probably), then let the user pick a color and save it to user defaults. Link all items that need to get the theme to the color from the user defaults. Then use the tintColor property of the UIImageView to themefy your app.
Method to tint any UIImageView:
- (void)tintImageView:(UIImageView *)imageView withTint:(UIColor *)tintColor
{
imageView.image = [imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[imageView setTintColor:tintColor];
}
Example use to tint Button:
[self tintImageView:self.button.imageView withTint:[UIColor blueColor]];
Example use to tint UIImageView:
[self tintImageView:self.imageView withTint:[UIColor blueColor]];
If you're using iOS7 you can take advantage of the tintColor property.
For images you need to be sure they are created using template option.
Please checkout this clear tutorial that will guide you to apply themes to different kind of controls in your app: Theming iOS Applications
You could probably be interested in trying Pixate Freestyle too, which basically allow you to apply styles like css does to your iOS app, that a pretty cool tool and I've found it very easy to use too.

iOS5 button transparency with png image as background

I am running into some problems with one button that I am customizing for my app and I need some help with it. When I test the button with iOS 6 there are no problems with the button transparency and the png image is viewed like this
but when i test my app with iOS 5 the button is not transparent:
I have the following settings for the button:
Thanks in advance for any suggestions of how to solve this problem.
Have you kept Button Type as UIButtonTypeCustom in UIButton Type property

Are there any default background images you can choose from in the iOS SDK?

When I do a UIModalTransitionStyleFlipHorizontal I want to see the bg image from the multitasking menu or from when you drag a outside of a page in Safari. Is this something Apple supply?
Sort of, yes. Take a look at these UIColor methods:
+ groupTableViewBackgroundColor
+ viewFlipsideBackgroundColor
+ scrollViewTexturedBackgroundColor
+ underPageBackgroundColor
You can use those to set background "colours" which are actually pattern image colours. Other than those there is nothing else supplied (as far as I know anyway).
For example (thanks #JonRamvi):
window.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
The cross hatch background colour is available as scrollViewTexturedBackgroundColor, a class method on UIColor. If you want to see that during a modal transition I think you should set the backgroundColor of the apps window in the app delegate to this colour

Resources