开发者

What is the android equivalent to an iOS uitableviewstylegrouped

I have data in the form of an array 开发者_如何学JAVAof key value pairs. Some of the data is related to other data in the array. What is the best way to show this in android? I know that a uitableview of uitableviewstylegrouped would be best for iOS but what is the best approach in Android?

This is some example data I would like to group into sections:


FirstName, "Joe"

LastName, "Smith"


Phone Number, "555-5555"

email, "joesmith@gmail.com"


YOu need to use the Simple ListView in Android to show up the List Now the problem is you want to show it like an iOS UITableView, so you need to make the background of the listView white and round the corners of the ListView.

This link might be helpful for you how to make the corners rounded of list View..

How do I create a ListView with rounded corners in Android?

Tell me more if you have any queries.


Check TableLayout

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1">

<TableRow>
    <TextView
        android:layout_column="1"
        android:text="FirstName"
        android:padding="3dip" />
    <TextView
        android:text="Joe"
        android:gravity="right"
        android:padding="3dip" />
</TableRow>

<TableRow>
    <TextView
        android:layout_column="1"
        android:text="LastName"
        android:padding="3dip" />
    <TextView
        android:text="Smith"
        android:gravity="right"
        android:padding="3dip" />
</TableRow>

<View
    android:layout_height="2dip"
    android:background="#FF909090" />

<TableRow>
    <TextView
        android:layout_column="1"
        android:text="Phone Number"
        android:padding="3dip" />
    <TextView
        android:text="555-5555"
        android:gravity="right"
        android:padding="3dip" />
</TableRow>

<TableRow>
    <TextView
        android:text="Email"
        android:padding="3dip" />
    <TextView
        android:text="joeSmith@gmail.com"
        android:gravity="right"
        android:padding="3dip" />
</TableRow>

</TableLayout>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜