1
我想創建一個ap,它在頁面的底部有一個列表,當我向下滾動屏幕時,屏幕頂部消失並僅顯示元素列表(以及何時我再次向上滾動它顯示我的頁面頂部再次) - 在Facebook應用程序相同..像在Facebook中的元素列表
我試圖實現它,這是我的xml與列表視圖和滾動視圖,但它不工作如預期。 。
當我滾動頁面的網頁原封不動,只有當我滾動列表視圖,列表視圖下降,但是頁面的頂部保持和列表視圖保持相同的大小)
我該如何在facebook android應用程序中執行相同的列表?
非常感謝
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff" >
<!-- Header Starts -->
<LinearLayout
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@layout/header_gradient"
android:paddingBottom="5dip"
android:paddingTop="5dip" >
<!-- Logo Start -->
<!-- Logo Ends -->
<com.facebook.widget.ProfilePictureView
android:id="@+id/profilePictureView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="18dp"
android:layout_weight="1" >
</com.facebook.widget.ProfilePictureView>
<TextView
android:id="@+id/profileNameText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="80dp"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName" />
</LinearLayout>
<!-- Header Ends -->
<ImageView
android:id="@+id/freinds"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_below="@+id/detailsText"
android:layout_marginRight="40dp"
android:layout_marginTop="17dp"
android:src="@drawable/logo" />
<ImageView
android:id="@+id/LikeImage"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignTop="@+id/freinds"
android:layout_marginRight="27dp"
android:layout_toLeftOf="@+id/freinds"
android:src="@drawable/logo" />
<TextView
android:id="@+id/detailsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/header"
android:layout_marginTop="16dp"
android:layout_toLeftOf="@+id/freinds"
android:ems="10"
android:inputType="textMultiLine" >
<requestFocus />
</TextView>
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/freinds" >
<Button
android:id="@+id/registerTwitter"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Sale" />
<Button
android:id="@+id/registerFB"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Deliver" />
<Button
android:id="@+id/clearCredentials"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Group" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/linearLayout1"
android:orientation="vertical" >
<EditText android:id="@+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:hint="Search">
</EditText>
<ListView android:id="@+id/ListView01"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
</ListView>
</LinearLayout>
</RelativeLayout>
</ScrollView>
嗨,謝謝你的回答,我不明白你的意思,你能舉個例子嗎?我不知道如何滾動視圖事件將幫助我 – 2013-03-07 23:41:47