gpt4 book ai didi

android - Android 相当于 iPhone 上的表格 View 是什么?

转载 作者:太空狗 更新时间:2023-10-29 13:42:27 24 4
gpt4 key购买 nike

谁能告诉我在 Android 中类似 iPhone 上的表格 View 的等效组件是什么?

如何在 Android 中像 iPhone 一样实现表格 View 组件?

举个例子。

最佳答案

您可以使用表格布局

TableLayout 将 View 分组为行和列。您使用该元素来指定表格中的一行。

<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="#000044">
<TableRow>
<TextView id="@+id/textName" android:text="Name:" android:textColor="#ffffff" />
<EditText id="@+id/editName" android:width="240px" />
</TableRow>
<TableRow>
<TextView id="@+id/textPasswd" android:text="Password:" android:textColor="#ffffff" />
<EditText id="@+id/editPasswd" android:password="true" />
</TableRow>
<TableRow>
<Button id="@+id/buttonSignIn" android:text="Sign In" />
</TableRow>
</TableLayout>

更多信息请引用以下链接

http://androiddevel.blogspot.com/2007/12/tablelayout-example.html

http://mobiforge.com/designing/story/understanding-user-interface-android-part-1-layouts

关于android - Android 相当于 iPhone 上的表格 View 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4049407/

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