问题标签 [android-tablelayout]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - android:layout_column 到底是做什么的?
我正在学习 android,并且正在努力理解这个特定的布局属性,阅读它说的谷歌开发文档:
此子项应位于的列的索引。必须是整数值,例如“100”。这也可能是对包含此类型值的资源(形式为“@[package:]type:name”)或主题属性(形式为“?[package:][type:]name”)的引用. 这对应于全局属性资源符号 layout_column。
谁能解释这如何映射到 html 等价物(因为表行似乎从它们那里大量借用)?
是它需要的列数 - 例如colspan?
android - Adding rows to an empty TableLayout during execution
I am trying to add a bunch of rows to an empty Table during execution. I have tried using some test code but for some reason the screen stays empty. If I had elements in the .XML They do show up, but not the table itself, unless I add some rows/elements inside the .XML file as well.
I would really appreciate some help.
My class extends Activity.
Here is the code to update the Table:
I call the code using a Handler this way, from a Thread:
The code does get run and does not print any error.
This is the XML file:
Any help would be very useful. I am very stuck right now.
EDIT: Using ListView
And the XML:
Rather than the TableLayout.
android - 在表格布局中跨 2 行拉伸
如何在TableLayout
. 我有 2 行带有标签并在 1 行上编辑文本,我想要一个按钮横跨整个第二行。
android - Android TableLayout宽度问题
我正在使用 TableLayout 来显示数据。活动调用 onCreate() 时将设置右列 TextViews 的文本。
现在,正如您在下图中看到的那样,我的地址文本可能很长并且应该被换行。所以我设置android:layout_width="wrap_content"
. 但它仍然需要屏幕大小的宽度来包装数据。我该如何克服这个问题?
我的xml:
android - 是否可以在 Android 项目的同一表格行中拥有 imageview 和 textview?
我正在尝试使用 imageview 和 textview 创建一个动态行。像这样的东西:
所以我的问题是,是否有可能在同一行在 java 源代码中的 imageview 附近有一个 textview,而不使用 xml 文件。
这是我的代码:
这段代码的结果是创建两个不同的行,一个带有图像,一个带有 textview。
android - 机器人:拉伸列
我想我只是没有在这里找到一个好的解释。那么谁能告诉我android:stretchColumns
实际上是做什么的?我把它放在我的桌子上,并尝试了几个不同的值,但似乎无法弄清楚它在做什么。
对不起这个愚蠢的问题!
android - 在 Android 上将视图添加到 TableRow 时出现 IllegalStateException
我目前正在创建一个将行添加到现有表的应用程序。代码如下所示:
在 XML 中,我有一个表格布局,它位于一个 linearLayout 内,它位于一个 frameLayout 内,位于一个 tabwidget 内,它看起来像这样:
创建这些标签工作正常,但是当我想将文本添加到一行时,应用程序崩溃并且我收到“IllegalStateException”,详细消息是:
指定的孩子已经有一个父母。您必须首先在孩子的父母上调用 removeView()。
我不太明白。当我查看这样的教程时,没有任何东西必须首先删除。那么我到底做错了什么?
android - 添加到表格的行未显示
以前有人问过这个问题,但我还没有找到适合我的解决方案:
从代码向表中添加行时,这些行不会显示在应用程序中。我在 XML 中指定了一行,该行正在显示,但在其下方没有任何内容。
这是代码,我也添加了我的类的构造函数:
homepage.xml 包含这个,我删除了一些元素和参数:
不幸的是,hierarchyviewer.bat 不适用于我检查行是否存在但不可见。在调试器中它对我来说看起来不错。
android - 是否可以将 TableLayout 与 ArrayAdapter 绑定?
是否可以将 TableLayout 与 ArrayAdapter 绑定?
android - Android强制退出
我正在运行此代码,并且模拟器正在发布强制退出。有谁知道可能出了什么问题?