jQuery switchClass and background images - jquery-ui

I want to change an element's class, and have the new class swap in a different background image. I do not care about animating the change (background images cannot be animated in any case--see below). But I do want to invoke a callback function after the class change (and its css effects) have fully taken effect.
Not all styles can be animated. For example, there is no way to animate a background image. Any styles that cannot be animated will be changed at the end of the animation.
http://api.jqueryui.com/switchClass/
Do I understand correctly, that the switchClass callback function's execution and the change of background style could be ongoing concurrently? There's no way to figure out when the background image style change has been completed?

Related

Changing Alpha on UITableview background makes interesting transition

I have an app that contains a UITableview. I selected a color for the background using IB. Later, I changed the alpha of that background because it looked better. However, when I now transition to that UITableview it seems to transition in twice. Once with the correct color and alpha, and once with the color without the alpha. I have included a link to a video of what I am talking about.
I thought perhaps I had done something wrong so I made a sample project. Just a simple UITableview on the second view controller (TableviewController). If I do not adjust the alpha it transitions correctly. But as soon as I change the alpha, it's transition is not correct. I have done nothing in code for this, but was wondering if I was doing something incorrectly, or if someone else has come across this problem.
The first part of the video is the sample app I made, and the second part is my actual app.

How to achieve smooth transition when image of button changes between states?

In iOS, we use the UIView animate block for tyo make chnages to properties of any control and that happens with a smooth transition.
Is it possible to achieve that when images of different state changes for UIButtons ?
What I can think of as of now is to manually change the image or state in animation block.
Is there a simpler way at the interface builder level or may be at code level so that I dont have to do this ?
Check out this Stackoverflow answer
link
I would subclass UIButton like in this answer so you only need to write the code once.

How to copy the background view of the actual Navigation Bar?

How can I copy the actual UINagivationBar background appearance? I would like to have the exact background appearance to use on another view.
I don't think there's a direct way to access the gradient background of the UINavigationBar. You can, however, play around with mockup versions of the background here and create your own version using Photoshop.

How to use UIActivityIndicator as a status indicator in real time for iOS?

]]I am trying to build a UIActivityIndicator for my iOS app so that it is displaying the current state of certain processes that are running, and each quarter segment of the wheel will be highlighted by a different colour, depending on the status.
All of the tutorials I have seen show how to build an activity indicator that spins while something is loading, whereas I need the indicator to remain on the screen and show state. I need the indicator to remain hollow, with only the circumference that is coloured. How would I do this?
Core graphics. You'll have to make a custom class that inherits from UIView and do all the drawing yourself. You'll probably override a setter for a float (progress), which will update the display (using [self setNeedsDisplay]. Then in the drawRect: method you'll use this class property of progress to determine what color and what angle to draw/fill in the view. Check out the source of MBProgressHud for some reference: MBProgressHUD

Changing look when tapping button with layer gradient

I used this question:
How to create a UIButton with a black gradient for iPhone?
... to set up a color gradient as the background of my button and it looks great, but when I tap the button it doesn't visibly change and give the user any feedback that they successfully tapped the button.
How can I set up a second gradient for the highlighted state or something like that?
Well, you are setting a sublayer and not providing any content to the button's views. The sublayers are drawn directly, so the UIButton doesn't think it has any content to "highlight". If you want a different effect on your button when you select it, there are three simple approaches.
One is to make two images with gradients. A pressed and normal state. This is much simpler as you can design them as you want and its a simple one line, one time implementation.
The other option is adding selectors that get called when your button gets UIControlEventTouchDown and whichever other Control Event(s) you want to have it switch back under.
The last simple option is to subclass UIButton and use the UIResponder touch methods to determine when to manually switch between the different background types.

Resources