如何创建一台S preadSheet一种显示在Android的? [英] How to create a SpreadSheet kind of display in Android?

查看:63
本文介绍了如何创建一台S preadSheet一种显示在Android的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想展示一台S preadSheet在Android应用程序auot可调列和每一列应包围lines.I使用的表布局中的数据显示在表格式,但我不知道如何包围用线每列,自动adjustment.If任何人都知道这一点,请帮助我。

I am trying to display a SpreadSheet in the Android application with auot adjustable columns and each columns should surrounded by lines.I used the Table Layout the data are displayed in the Table format but i dont know how to surround each column with lines, auto adjustment.If anyone knows it please help me.

推荐答案

使用的 TableLayout.LayoutParams TableRow.LayoutParams 。他们继承 ViewGroup.MarginLayoutParams ,你似乎需要。

Use TableLayout.LayoutParams or TableRow.LayoutParams. They inherit ViewGroup.MarginLayoutParams, which you seem to need.

一个样本code与TableRow.LayoutParams可能是:

A sample code with TableRow.LayoutParams could be:

// you can also init values for width, height and weight here
TableRow.LayoutParams params = new TableRow.LayoutParams();
params.setMargins(LEFT_MARGIN, TOP_MARGIN, RIGHT_MARGIN, BOTTOM_MARGIN);

TextView textView = new TextView(this);
textView.setText("I'm in the table");

TableRow row = new TableRow();
row.addView(textView, params);

同样的原理也与TableLayout.LayoutParams应用,当你添加到表格的布局。

The same principle could be applied with TableLayout.LayoutParams, when you add to the table layout.

这篇关于如何创建一台S preadSheet一种显示在Android的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆