Onlclick监听器工作不正常..? [英] Onlclick listener is not working properly..?

查看:229
本文介绍了Onlclick监听器工作不正常..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有按钮,这是我用旋转动画旋转45度和应用的点击侦听器,敬酒的消息。

I have button, which i rotated 45 degrees using rotate animation and applied on click listener that toasting a message.

当我点击按钮吐司上50%的显示。 但是,当我点击的按钮,没有任何降低50%displying。

When i click on upper 50% of the button toast is displaying. But when i click on lower 50% of the button nothing is displying.

下面动漫code。

<?xml version="1.0" encoding="utf-8"?>
<rotate
 xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromDegrees="45"
    android:toDegrees="45"
    android:pivotX="50%"
    android:pivotY="50%"
    android:duration="0" android:fillAfter="true">
</rotate>

在此先感谢.....!

Thanks in advance.....!

推荐答案

我是pretty的肯定,这是动画在Android的限制。他们固定在3.0起,通过实施新的动画系统。

I'm pretty sure this is a limitation of animation in Android. They fixed it in 3.0 onwards by implementing a new animation system.

在这里阅读: http://android-developers.blogspot.com/2011/02 /animation-in-honeycomb.html

最后,previous动画改变了目标对象的视觉外观...但他们并没有真正改变对象本身。你可能碰到这个问题。比方说,你要移动一个按钮从屏幕到另一边,你可以使用TranslateAnimation这样做,并且按钮将愉快地沿着屏幕的另一边滑行,当动画完成后,它会很高兴地跳回到原来的位置所以你会发现在动画的setFillAfter(true)方法,并再次尝试这个时候的按钮将保持发生在位置,它被动画你可以验证通过点击 - 。嘿!如何来该按钮没有点击?问题是,动画的变化,其中绘制的按钮,而不是那里的按钮,可以在容器中存在。如果你想点击该按钮,你必须点击的位置,它住惯了,或者,作为一种更有效的解决方案(一只是一点点更有助于你的用户),你必须写你的code实际上当动画更改布局按钮的位置完成

"Finally, the previous animations changed the visual appearance of the target objects... but they didn't actually change the objects themselves. You may have run into this problem. Let's say you want to move a Button from one side of the screen to the other. You can use a TranslateAnimation to do so, and the button will happily glide along to the other side of the screen. And when the animation is done, it will gladly snap back into its original location. So you find the setFillAfter(true) method on Animation and try it again. This time the button stays in place at the location to which it was animated. And you can verify that by clicking on it - Hey! How come the button isn't clicking? The problem is that the animation changes where the button is drawn, but not where the button physically exists within the container. If you want to click on the button, you'll have to click the location that it used to live in. Or, as a more effective solution (and one just a tad more useful to your users), you'll have to write your code to actually change the location of the button in the layout when the animation finishes.

正是由于这些原因,除其他外,我们决定提供一个全新的动画系统,蜂窝,一是建立在理念,以属性动画。

It is for these reasons, among others, that we decided to offer a new animation system in Honeycomb, one built on the idea of "property animation."

这篇关于Onlclick监听器工作不正常..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆