名前、電話番号、SMS ボタン、自宅の住所などのユーザーの連絡先情報を表示する必要があるアプリに取り組んでいます。Jellybean の People アプリがこの情報を連絡先情報ページに表示する方法がとても気に入っています。私は github でオープン ソース コードを見てきましたが、理解するのが非常に混乱しています。私のアプリで同じ機能を得ることができるように、そのxmlレイアウトがどのように構築されているかを誰か説明してもらえますか?
1989 次
4 に答える
2
これは、スワイプ可能なページと上部の 2 つの写真で役立つ場合があります: http://www.androidviews.net/2013/03/tab-carousel-library/
下線付きの青いラベルは、次の属性を TextView に追加することによって作成されます: style="?android:attr/listSeparatorTextViewStyle"
于 2013-07-19T19:23:11.427 に答える
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="#2FC9EC"
android:gravity="center_vertical">
<ImageView
android:id="@+id/image1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/back"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Title"
android:textSize="20dp"
android:textColor="#FFFFFF"/>
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<HorizontalScrollView
android:id="@+id/hori_scroll"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/image1"
android:layout_width="250dp"
android:layout_height="match_parent"
android:src="@drawable/ic_launcher"/>
<ImageView
android:id="@+id/image1"
android:layout_width="250dp"
android:layout_height="match_parent"
android:src="@drawable/ic_launcher"/>
</LinearLayout>
</HorizontalScrollView>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="PHONE"
android:textSize="20dp"
android:textColor="#50A7B3"
android:layout_marginBottom="5dp"/>
<View
android:layout_height="1dp"
android:layout_width="match_parent"
android:background="#728C93"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_marginTop="10dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:layout_weight="0.60">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="65656565"
android:textSize="20dp"
android:textColor="#696969"
android:layout_marginBottom="5dp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="MOBILE"
android:textSize="20dp"
android:textColor="#6D6D6D"
android:layout_marginBottom="5dp"/>
</LinearLayout>
<LinearLayout
android:layout_marginTop="10dp"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:layout_weight="0.40">
<ImageView
android:id="@+id/image1"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_launcher"/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="EMAIL"
android:textSize="20dp"
android:textColor="#50A7B3"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"/>
<View
android:layout_height="1dp"
android:layout_width="match_parent"
android:background="#728C93"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="xxxxxxxxxxxxxx"
android:textSize="20dp"
android:textColor="#696969"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="xxxxxxxxx"
android:textSize="20dp"
android:textColor="#6D6D6D"
android:layout_marginBottom="5dp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="xxxxxxxxxxxxxx"
android:textSize="20dp"
android:textColor="#696969"
android:layout_marginBottom="5dp"
android:layout_marginTop="20dp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="xxxxxxxxx"
android:textSize="20dp"
android:textColor="#6D6D6D"
android:layout_marginBottom="5dp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="IM"
android:textSize="20dp"
android:textColor="#50A7B3"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"/>
<View
android:layout_height="1dp"
android:layout_width="match_parent"
android:background="#728C93"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="xxxxxxxxxxxxxx"
android:textSize="20dp"
android:textColor="#696969"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="xxxxxxxxx"
android:textSize="20dp"
android:textColor="#6D6D6D"
android:layout_marginBottom="5dp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
于 2013-07-19T12:10:32.957 に答える