如何设置内容上多个按钮的大小
我使用三个按钮和列表视图。这三个按钮使用 TableLayout
和 TableRow
添加到布局中。第一个按钮占用了更多的内容空间,因此另外两个的尺寸会比第一个小。当应用程序运行时,它甚至不显示其他两个按钮。
如何使三个按钮的大小相等并在应用程序运行时显示所有按钮?请给我一些例子。
谢谢
I am using three buttons along with the list view.These three buttons are added to the layout using the TableLayout
and TableRow
.The first button takes more space on content, so the other two becomes smaller in size than first one. When the application runs, it doesn't even show the two other buttons.
How can I make the size of three buttons equal and display all of them when application runs?Give me some example please.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
android:layout_span="3"
放在第一行的 TextView 上,以及第二行的 ListView 上。从文档中:
由于 TextView 和 ListView 都位于第一列中,因此第一列的宽度将与这两列中最宽的列一样宽。通过将layout_span 设置为3,底部的三个按钮将位于各自的单元格中,且宽度相等。
Put
android:layout_span="3"
on your TextView in the first row, and on your ListView in the second row.From the documentation:
Since both the TextView and the ListView are in the first column, the first column is going to be as wide as the widest of those two. By setting the layout_span to 3, the three buttons at the bottom will be in their own cell with equal widths.