Android Data Binding: visibility on include tag

前端 未结 9 757
旧时难觅i
旧时难觅i 2020-12-24 10:38

As per http://developer.android.com/tools/data-binding/guide.html#imports, we can have such simple expressions in visibility:



        
9条回答
  •  清歌不尽
    2020-12-24 11:17

    Best Way

    1. You can directly pass Integer value of visibility like.
    2. You can set default value of visibility also by setting default=gone in binding.

    For example this is included_layout.xml

    
    
        
    
            
    
        
    
        
    
    
    

    and use like

    
    
        
    
          
    
        
    
       
    
    
    

提交回复
热议问题