views:

185

answers:

1

Hi!

I'm want to figure out such an issue:

I have a UIView dervied class in which there are several controls. Some of them must appear and disappear depending on selected mode. This is made by means of setting aplha value to respected component.

All controls adds procedurally through code in initWithFrame in normal way. All controls works as expected but UISlider! Setting its initial alpha to 0.0f in initWithFrame have no effect. This is especially strange because futher setting of its alpha in code works OK. This component already exists and NSLog displays it's address and setted alpha correctly. But real alpha is 1.0f!

If I replace UISlider to arbitrary other view its works properly. Why?

My guess - this is because of internal animation processes which is interfere alpha value upon creation.

The only workaround I use - to place slider on dummy view and set it's transparency.

Does anybody knows another solution?

A: 
uislider.hidden = YES;
Johannes Martinsson