开发者

Get Alpha/Opacity of Layout

开发者 https://www.devze.com 2023-02-07 11:22 出处:网络
How do I get the current Alpha/Opacity of Layout? I want the from of my AlphaAnimation to开发者_如何学Go be the current alpha so it doesn\'t flicker between my fade in and fade out calls. What kind of

How do I get the current Alpha/Opacity of Layout? I want the from of my AlphaAnimation to开发者_如何学Go be the current alpha so it doesn't flicker between my fade in and fade out calls.


What kind of layout do you have? This could work:

    LinearLayout layout = new LinearLayout(this);
    int opacity = layout.getBackground().getOpacity();


Going to opt for the Get and Set methods in Android 3.0 in future.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号