【问题标题】:What is the alternative in harmony OS for TableRow in android?android 中 TableRow 的 Harmony OS 中的替代方案是什么?
【发布时间】:2021-07-30 19:26:24
【问题描述】:

在 Harmony OS 中可以用什么来代替 TableRow? 它是 android 中 widget 包的一部分。

【问题讨论】:

    标签: java android huawei-mobile-services huawei-developers harmonyos


    【解决方案1】:

    目前 Harmony 没有 TableRow 的任何特定替代方案,但我想说 TableLayout 中不需要 TableRow Harmony OS 的组件,因为您将能够在没有 TableRow 的情况下创建 TableLayout,例如

        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;
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多