我有一個活動,其中包含一個滾動視圖,並有一個兩個孩子,但是當活動加載它不顯示頂部的部分,並從gridview頂部開始!android scrollview不顯示佈局的頂部
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/activityBackground"
tools:context="com.test.app.fragment.HomeFragment">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="60dp"
android:background="@color/ColorPrimaryDark"/>
<com.test.app.util.ExpandableHeightGridView
android:id="@+id/homeNormalGridView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:numColumns="2"
android:padding="5dp"
android:stretchMode="columnWidth" />
</LinearLayout>
</ScrollView>
<fr.castorflex.android.circularprogressbar.CircularProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/homeProgress"
android:layout_width="80dp"
android:layout_height="80dp"
android:indeterminate="true"
app:cpb_color="@color/ColorPrimary"
app:cpb_max_sweep_angle="300"
app:cpb_min_sweep_angle="10"
app:cpb_rotation_speed="1.0"
app:cpb_stroke_width="4dp"
app:cpb_sweep_speed="1.0" />
</RelativeLayout>
,你看,我有GridView和RelativeLayout的滾動型作爲一個孩子,但我沒有任何想法,爲什麼RelativeLayout的是要躲起來!
你能給我們一些截圖,讓我們更好地理解它嗎? – 2015-03-25 01:13:50
@nayoso它只是從gridview頂部開始,我必須向上滾動才能看到relativelayout! – user2549089 2015-03-25 01:17:06
但是在你向上滾動之後,你可以看到它,還是會反彈回來?相對佈局是否在操作欄之下? – 2015-03-25 01:18:38