您的位置:首页 > 其它

禁止ScrollView内的控件改变之后自动滚动

2015-12-17 22:01 309 查看
最近工作遇到一问题,在布局界面ScorllView中嵌套了几个 childView。其中有一个childview高度较高且超出了屏幕范围,当每个 childview都能获取焦点时,由于一屏显示不完,最下面的childview会自动滑动到最后

<ScrollView
android:id="@+id/ScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:overScrollMode="never"
android:scrollbars="none" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical" >
<span style="white-space:pre">	</span></LinearLayout>
</ScrollView>


只用在LinearLayout里加2行代码就不会自动下滑了

android:focusable="true"
android:focusableInTouchMode="true"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: