利用weight属性,让不可见的View占据屏幕上方的1/8即可:
<LinearLayout
android:id="@+id/layout_guide_02"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/guide_02"
android:weightSum="8"
android:visibility="gone" >
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:visibility="gone"
</View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="7"
android:gravity="center_horizontal" >
<ImageButton
android:id="@+id/btn_guide_02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/iknow" />
</LinearLayout>
</LinearLayout>