android - ConstraintLayout 随着 TableLayout 中的表行数的增加而扩展
问题描述
如何随着 TableLayout 中的 tablerows 的增加而增加 ConstraintLayout 的长度?
解决方案
试试这个方法...
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:text="Time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1" />
<TextClock
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textClock"
android:layout_column="2" />
</TableRow>
<TableRow>
<TextView
android:text="First Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1" />
<EditText
android:width="200px"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow>
<TextView
android:text="Last Name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1" />
<EditText
android:width="100px"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RatingBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ratingBar"
android:layout_column="2" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit"
android:id="@+id/button"
android:layout_column="2" />
</TableRow>
</TableLayout>
</android.support.constraint.ConstraintLayout>
推荐阅读
- julia - 创建一个数组,其值符合与平均值的最小距离标准
- android - pc没有在android中询问调试授权权限
- android - Android:文件/文件夹加密
- arrays - 在匹配值并满足条件的 3 个数组之间进行迭代的更快方法?打字稿
- python - Python:如何使线程等待的时间超过其初始超时时间?
- tensorflow - tensorflow - ValueError:找不到匹配的函数来调用从 SavedModel 加载
- c++ - 动态特征矩阵随机初始化
- excel - 将列表的随机顺序返回到单个单元格中
- angular - 剑道网格过滤器菜单和角度材质选择 - 每当您进行选择时关闭
- apache-kafka - Kafka 压缩主题,retention.ms 是否适用于它们?