/* * Copyright (c) 2023 iSoftStone Information Technology (Group) Co.,Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { MessageManager,Callback } from '../../../../common/MessageManager'; @Entry @Component struct FlexPadding_Stretch { @State testPadding: number = 0 messageManager:MessageManager = new MessageManager() private content: string = "FlexPadding_Stretch Page"; onPageShow() { console.info('FlexPadding_Stretch onPageShow'); globalThis.value = { name:'messageManager',message:this.messageManager } let callback:Callback = (message:any) => { console.log('message = ' + message.name + "--" + message.value); if (message.name == 'padding') { this.testPadding = message.value; } } this.messageManager.registerCallback(callback); } onBuildDone() { console.info('FlexPadding_Stretch page build done called'); } build() { Column() { Column() { Text('FlexPadding_1').fontSize(9).fontColor(0xCCCCCC).width('90%') Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Stretch, wrap: FlexWrap.NoWrap, }) { Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('textFlexPadding01') Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('textFlexPadding02') Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('textFlexPadding03') } .key('flexPadding01') .height(200) .width(500) .padding(this.testPadding) .backgroundColor(0xAFEEEE) }.width('100%').alignItems(HorizontalAlign.Start) }.width('100%') } }