How to apply a color filter to a view with all children

前端 未结 5 562
误落风尘
误落风尘 2020-12-24 02:45

How do I grey out a view uniformly which contains many different items - ImageViews, TextViews, background image. Do I have to grey out each thing individually? Or is there

5条回答
  •  温柔的废话
    2020-12-24 03:05

    What I like to do is create a view which overlaps the view you are trying to tint and set its background to a transparent color. Then you can turn the tint on and off by setting that views visibility

    
    
        
    
        
    
    
    

    Then in your controller:

    m_DisabledBlackTintOverlay = (View) view.findViewById(R.id.login_disabled_black_tint_overlay);
    
    m_DisabledBlackTintOverlay.setVisibility(View.VISIBLE);
    

提交回复
热议问题