How to use new features in constraint layout 1.1?

前端 未结 4 609
忘掉有多难
忘掉有多难 2020-12-28 15:56

Does anyone know how to use new features in constraint layout 1.1, namely barriers and percent-based dimensions? There is absolutely no documentation available online, and t

4条回答
  •  既然无缘
    2020-12-28 16:48

    Here is the official doc that perfectly explains all new features added in constraint layout 1.1

    But one more thing to note for Groups is that if you give your view as a reference id in Group, its individual visibility will not work, for that to work you will need to create a separate Group for it. Do correct me if I am wrong. Here is the sample code which uses Group, as you can see here view1's visibility will not work as it is assigned to a group.

        
        
    
        
    
        
    
        
    
        
    
        
    
    
    

    Now to overcome this we can create a new group to handle view1's visibility, as given below.

    
    

    This is the workaround I came across, if there is such scenario where we want to handle a group's visibility as well as individual view's visibility in different cases.

提交回复
热议问题