我有一個ScrollView佔據了屏幕的下半部分。 在這個ScrollView裏放置了一個LinearLayout(垂直),內容很多。 當我開始活動時,內容會自動向下滾動,以便從窗口頂部開始。但我需要它從ScrollView的頂部開始(即在窗口的中心)。 我在做什麼錯? ScrollView內的LinearLayout被自動滾動到底部
<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="match_parent"
tools:context="ru.intrigue.activities.EditActivity"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="250dp"
android:visibility="visible">
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollView2"
android:background="@color/colorDarkBack">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp">
<!-- content -->
</LinearLayout>
</ScrollView>
</LinearLayout>
張貼相關的代碼以及 – SMR
你如何設置你的'滾動型'佔據屏幕的一半? – SlashG
把你的xml放在這裏 –