Android开发:布局分区域设置不同背景色

在一个大布局里,有时候需要通过设置不同的背景色来分割不同的功能区,这需要设置子布局的颜色。layout设置举例如下:





    
        android:background="@color/colorPrimary"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        

        
        
    
    
     
        android:background="@color/colorAccent"
        <-以下省略-->
        >
        <-以下省略-->        
    
    

关于不同布局的混合使用可参见本人的另一博文:Android开发:不同布局的混合搭配使用https://blog.csdn.net/nny886/article/details/83828396

你可能感兴趣的:(Android,Layout)