1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16@Entry 17@Component 18struct GridRowSample3 { 19 private bgColors: ResourceColor[] = [ 20 $r('sys.color.ohos_id_color_palette_aux1'), 21 $r('sys.color.ohos_id_color_palette_aux2'), 22 $r('sys.color.ohos_id_color_palette_aux3'), 23 $r('sys.color.ohos_id_color_palette_aux4'), 24 $r('sys.color.ohos_id_color_palette_aux5'), 25 $r('sys.color.ohos_id_color_palette_aux6') 26 ] 27 28 build() { 29 GridRow({ columns: { sm: 4, md: 8, lg: 12 }, 30 gutter: { x: { sm: 8, md: 16, lg: 24 }, y: { sm: 8, md: 16, lg: 24 } } 31 }) { 32 ForEach(this.bgColors, (bgColor) => { 33 GridCol({ span: { sm: 2, md: 2, lg: 2 } }) { 34 Row() 35 .backgroundColor(bgColor) 36 .height(30) 37 } 38 }) 39 } 40 } 41}