javaandroidhuawei-mobile-servicesharmonyosdeveco-studio

Can multiple directional layouts be created?


Using DevEco Studio can one directional layout be created in another directional layout ? If Yes how can we do that ?


Solution

  • You could create multiple DirectionalLayouts in the XML layout file of the resource-layout for parallel or nesting.

    Could refer to the following code:

    <DirectionalLayout
        ohos:height="match_content"
        ohos:width="match_parent"
        ohos:orientation="horizontal">
    
        <DirectionalLayout
            ohos:height="match_content"
            ohos:width="match_parent"
            ohos:orientation="horizontal">
        </DirectionalLayout>
        
        <DirectionalLayout
            ohos:height="match_content"
            ohos:width="match_parent"
            ohos:orientation="horizontal">
        </DirectionalLayout>
    
    </DirectionalLayout>