gpt4 book ai didi

android - 两个并排的 TableLayouts

转载 作者:行者123 更新时间:2023-11-29 16:08:05 27 4
gpt4 key购买 nike

是否可以并排显示两个 TableLayout(在 RelativeLayout 中)以使两个表格具有相同的宽度?我只是不知道该怎么做。我已经尝试过将 android:stretchColumns="*" 设置到两个表,但它只是将一个表拉伸(stretch)到 100% 宽度,而第二个表被推出屏幕。

最佳答案

您可能可以使用 LinearLayout 并将每个 TableLayout 权重设置为 0.5

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TableLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
<TableLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5" />
</LinearLayout>

关于android - 两个并排的 TableLayouts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16290845/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com