ScrollView内的控件改变之后自动滚动的问题
2015-06-25 13:15
495 查看
ScrollView中控件的长度发生改变,这时ScrollView会自动下滚到变化的控件处。滚动的那一下体验特别不好,所以要防止这种情况。
<ScrollView android:id="@+id/scroll" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:focusable="true" android:focusableInTouchMode="true" > <!-- 上面这两行是控制scrollview android:focusable="true" android:focusableInTouchMode="true" 不自动的关键! !--> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <!-- GridView高度可变 --> <GridView android:id="@+id/gridView" android:layout_width="match_parent" android:layout_height="wrap_content" android:horizontalSpacing="@dimen/gridview_spacing" android:numColumns="3" android:verticalSpacing="@dimen/gridview_spacing" /> </LinearLayout> </LinearLayout> </ScrollView>
相关文章推荐
- 开通博客,关于博主。
- Android textView点击滚动(跑马灯)效果
- 重大事件网站整体灰度处理代码
- java基础—网络编程———聊天窗口的建立
- 自动布局之autoresizingMask使用详解(Storyboard&Code)
- Hibernate ManyToMany 配置
- 检查 iphone 是否安装某 app
- 杭州幼儿园汇总
- Algs4-2.2.17链表归并排序
- 设计模式 -------------------外观模式
- 设计模式简单总结
- 导出表数据为xml过程
- 中移物联笔试题
- hashmap hashtable 的区别
- ajp
- 公正调解 为民解忧
- Java使用正则表达式对日期类型进行格式转换
- DOORS默认管理员用户名
- 知名应用背后的第三方开源项目
- Oracle XMLTable Tutorial With Example