我有一个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放在这里 –