applibgroup / HarmonyOS-Knowledgebase

This repository contains code samples of HarmonyOS Training
Apache License 2.0
17 stars 6 forks source link

What is the alternative in harmony OS for TableRow in android? #59

Closed yashrajgupta closed 3 years ago

yashrajgupta commented 3 years ago

What can be used in place of TableRow in harmony OS? It is a part of widget package in android

https://stackoverflow.com/questions/68596209/what-is-the-alternative-in-harmony-os-for-tablerow-in-android

Additional information

Developer Platform: Windows
DevEco Studio version: 2.1.0.303
SDK API version: 5
SDK version: 2.1.1.21
Device: Not Required
Device OS version: Not Required

GowthamRayar commented 3 years ago

Currently Harmony doesn't have any specific alternative for TableRow, but I would say there is no need for TableRow in TableLayout Component of Harmony OS, as you will be able to create TableLayout without TableRow, For Example

    private TableLayout createTableLayout() {
        tableLayout = (TableLayout) mDialogLayout.findComponentById(ResourceTable.Id_md_table_layout);
        ComponentContainer.LayoutConfig layoutConfig = new ComponentContainer.LayoutConfig(ComponentContainer.LayoutConfig.MATCH_CONTENT,
                ComponentContainer.LayoutConfig.MATCH_CONTENT);
        tableLayout.setRowCount(getRowCount());
        tableLayout.setColumnCount(getColumnCount());
        tableLayout.verifyLayoutConfig(layoutConfig);
        for (int position = 0; position < getCount(); position++) {
            CircleView cv = new CircleView(mContext);
            cv.setLayoutConfig(cvlayoutConfig);
            tableLayout.addComponent(cv);
        }
        return tableLayout;
    }

also please refer : https://stackoverflow.com/questions/68596209/what-is-the-alternative-in-harmony-os-for-tablerow-in-android