最近工作遇到一问题,在布局界面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">

</LinearLayout>

</ScrollView>


android:focusable="true"

android:focusableInTouchMode="true"
只用在LinearLayout里加2行代码就不会自动下滑了


更多相关文章

  1. Android(安卓)实现类似美团的菜单效果
  2. Android(安卓)GridView 滑动条设置一直显示状态(推荐)
  3. Android(安卓)SQLite 支持嵌套事务吗?
  4. android轮播图示例
  5. Android滑动(三)——scrollTo与scrollBy
  6. Android中Fragment嵌套Fragment,切换Fragment时不显示视图的原因
  7. 高仿苹果通讯录布局
  8. [Android]通过PhoneLookup读取所有电话号码
  9. android Activity如何横屏显示?如何解决Activity在设置横屏时候会

随机推荐

  1. android LruCache源码解析
  2. Android之入门:多线程更新UI界面
  3. Android(安卓)AsyncTask源码剖析
  4. Android对国际化的支持
  5. WINDOWS7环境下android studio、NDK配置
  6. Android(安卓)10开启调试模式
  7. Android通过lame进行音频格式转换
  8. android开发――通过子线程更新界面UI
  9. Android视频播放项目总结之 使用第三方Vi
  10. Android(安卓)调用系统相机,拍照,并上传图