单选按钮没有按下变暗效果

单选按钮,做选项卡按钮得时候,设置按下变暗,现在按下没有效果,松开直接变成选中状态。 没有按下状态,你们是怎么处理的。
已邀请:

lanys

赞同来自:

设置变暗,没有效果,请问怎么处理?

lanys

赞同来自:

public void SetDownEffect()
        {
            this.onTouchBegin.Add(() => { this.SetEffect(true); });
            this.onTouchEnd.Add(() => { this.SetEffect(false);  });
        }

        private void SetEffect(bool value)
        {
            Color color;
            if (value)
                color = new Color(_downEffectValue, _downEffectValue, _downEffectValue);
            else
                color = Color.white;
            GObject obj = _iconObject;
            if ((obj is IColorGear) && !(obj is GTextField))
                ((IColorGear)obj).color = color;
        }
 
在Gbutton里面,自己写了个方法,可实现。代码调用SetDownEffect

要回复问题请先登录注册