-4
私は4または5アイテムのリストビューを含むアンドロイドアプリを開発中です。 Gmailのアプリがメールを表示する方法と似ているhttp://pctechtips.org/data/unnamed.png しかし、私はそれらの間のいくつかの目に見える線で項目を分離するのが難しいです。国境などのように。これを行う正しい方法は何ですか?また、テキストを垂直にセンタリングする適切な方法は何ですか? おかげリストビューのアイテム間で分割を作成するには
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context="com.example.george.droidnet.MainActivity">
<TextView
android:id="@+id/hostname"
android:layout_height="100dp"
android:layout_width="match_parent"
android:background="@color/primary"
android:textSize="24sp"
/>
<TextView
android:id="@+id/address"
android:layout_height="100dp"
android:layout_width="match_parent"
android:text="IP Address"
android:background="@color/primary_light"
android:gravity="top|bottom"
android:textSize="24sp" />
<TextView
android:id="@+id/connections"
android:text="Connections"
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@color/primary_light"
/>
<TextView
android:id="@+id/DNS Queries"
android:background="@color/primary_light"
android:text="Ping"
android:layout_width="match_parent"
android:layout_height="100dp" />
<TextView
android:id="@+id/Ping Host"
android:background="@color/primary_light"
android:text="Ping"
android:layout_width="match_parent"
android:layout_height="100dp" />
</LinearLayout>
仕切りを追加する方法を検索してくださいに 'ListView'または' LinearLayout' –
は、例えば、リストビューまたは単に下のリストビューでパディング/マージンを追加するために仕切りを追加し、そこに多くの方法があります項目 –