Facebook Icon/Button Glowing in iOS App - ios

Does anyone know/have a guess as to how facebook implemented the glowing of the icon when a user taps the icon? (You can see what I mean below) It seems to me that they implemented at least part of it programmatically as the glowing actually spills over on the icon next to it. Has anyone done this or have pointers where to start? It does not seem to spill out of the UINavigationBar, however.
PS. I do know how to make the icons up on the navigation bar, just not sure how to implement the glowing...

UIButton has a property called showsTouchWhenHighlighted. When you set this to true, it puts that glow whenever you tap it.
For some reason it goes behind the icon when you use it as a custom view of a UIBarButtonItem in a UIToolbar or a UINavigationBar (contrary to if you simply set the image of the UIBarButtonItem).

Related

iOS: How to change UIDocumentInteractionController's background color when tapped

As I searched on Google, this question has been asked by several users before, but no one answered, for example:
UIDocumentInteractionController - Change background Color and prevent status bar popup
It seems some people like me really hope to know what we can do to change the documentController's background color when it enters full screen. Now, the default is black. The thing is, UIDocumentInteractionController is not a subclass of UIViewController, but a subclass of NSObject instead, which makes it impossible to access its "view" property directly.
So I hope to know what might be done to change its background color?

iOS map style config slide up?

iOS 7 has changed how maps are displayed by apps on the iPhone, and especially how the user configures the map.
The map is displayed like this, with an Info button.
When the user taps the Info button, the configuration screen slides up.
How do I recreate a screen overlay like this in my code? While I don't want the user to be dropping pins, I want the user to be able to switch between different map styles or open the address I'm pointing to in Apple's Maps app.
If you are trying to do a simple overlay view, then look into making an UIView slide up through UIView animations. Other than that, you would need an UISegmentedControl and related code. You would also need to blur the view and make it translucent, so look into my other question and answer on how to properly blur an UIView:How to apply blur to a UIView?
I've never looked into it, but I've heard the only easy way to do a translucent background (as in, without writing your own OpenGL code) is to create a UIToolbar instance.
I'm guessing you'd make a toolbar with no items, just treat it like UIView and add your own subviews (UITableView, etc). It is a subclass of UIView.

iOS: How to disable Fading in and out effect of UIButton

First of all, sorry for the title and asking this incredibly question but I simply couldn't figure it out. Also, since it is not related to code, I don't have code to show
I am working on an app and using iOS7 and I created a button from IB, set its background image to an image I designed. Connected it with header and set its touch up inside action as an IBAction
Yet, here is my problem. Whenever I click on the button, as an effect the image fades half transparent. I do not want this default attribute. I checked all the states on IB (highlighted, disabled, selected) and couldn't figure it out.
If I create the same button programmatically, only the text color changes, however when I set the background image, image fades (perhaps to indicate the button being pressed). How can I remove this effect?
A bit late but I believe this would solve the problem
in the xib file, set the button's type to Custom.
My button was set to system and when pressed on, it shows transparency and has a little fade in effect. Once I changed it to custom this effect is gone.
This cannot be changed once button is created. only in xib or when the button is first created.
have you tried this one yourButton.adjustsImageWhenHighlighted = NO?
If you set same background-image/background-color for every buttons states in IB (highlight, disable, selected) you will not get any fading in UIBUtton when you press it. You can set text color for every states also. If needed you can set different colors for every state and check the press action.
Hope the answered you expect. Thanks
Storyboard Solution
1:set button type to custom
2:uncheck "Highlighted adjusts Image"
If you want fading in & out effect your UIButton Type Should be a system, not custom.

iOS: Back toolbar bar button item

I need the back arrow toolbar bar button item.
In identifier of bar button item, there is play, refresh, reload, and stop.
I need the image of play, but flipped 180 degrees.
Is there a way to flip the image with code? If not, where can I find this image?
here's a simple work around:
declare your button with "initWithTitle" and set the title to #"◀" (it's just a unicode symbol).
Use #"▶" for the forward button to make it consistent.
I tried it and it worked for me.
Do a Google search for play button vector graphic. Make the one you want the image of the button. Should still be able to tell the button to maintain it's bar button style.
One straightforward option is to draw a white triangle of the appropriate size and orientation in an image editor, stick it in an image view, and then use that image view for a bar button item's custom view.
I wouldn't try to use the UIBarButtonSystemItemPlay image. I don't know if manipulating system images is expressly proscribed, but Apple generally doesn't smile on misuse of system items. When you get right down to it, it's just a white triangle, so it'd be hard to tell the difference between drawing your own or reversing theirs. That just seems like all the more reason to draw your own.

Facebook iPhone application: root view animation style

I'm working on an application that has the same layout as Facebook. I have several icons on the home screen and would like to to make my viewController appear like when one of the icons are tapped.
Any idea on how it works?
Are you asking how to make a view appear in the standard way when the icon is tapped? ie how to make a button which is an image
Or
are you asking how to make the view expand out like they do in the facebook app?
If your are asking the first one, you need to drag on a button in interface builder, then select it, in the button attributes window, in the first tab, in the 'type' drop-down (which is default to rounded rect), choose custom. then set either the image or background to your image (see whatever looks better). You can then link it up like a normal button with an IBAction.
If you are asking the second question, how do you make the views expand out and shrink back, then check out my tutorial:
How to make expanding/shrinking views on iPhone SDK
Adam

Resources