Hi
I use Pythonista in Version 2.1.1 (211008) on my iPhone 6 and I want to fade in and fade out a Label on a UI view. I found many examples but none of them works for me.
The scenario: The User of my app presses a button and in the background somthing happens. But the user gets no feedback. So I placed a Label on the screen center and after the button press event I want to show the label a secound and hide it.
I found the animate() function and tried it this way:
def showInfo(Infotext, aView):
def doAnimation():
aView['MyLabel'].alpha=1
aView['MyLabel'].text='This is my message'
ui.animate(doAnimation)
If i call the showInfo function the Label fades in on the screen. This works. But after a second I want to fade out the label. I tried many ways to implement a fade out but none of them works. I tried to define an second function called doAnimation2 with aView['MyLabel'].alpha=0 and called it the same way like doAnimate. I also tried to set the alpha value to 0 after the ui.animate call. But the label dosen't show. No fade in, no fade out. I also serached for a definition of the animate function but I only found a very small doku about this.
So, please help me.
-
How can I fade in and after a secound fade out my label in the example above?
-
What does the ui.animate function do exactly and what are the parameters of this function.
Many thanks
kluesi