android View移动总结
16lz
2021-01-26
android中View的移动分为两种,View位置的移动和View内容的移动。
一、 View位置移动的方法
- 修改mTranslationX或mTranslationY的值
- 设置MarginLayoutParams的margin值
- 设置ViewGroup.LayoutParams的width或height
- 设置View的mLeft、mRight、mTop、mBottom
- 对Matrix进行操作
二、View内容移动的方法,View内容移动针对的是有子View的View即ViewGroup的内容移动
- scrollBy()
- scrollTo()
- 通过Scroller平滑滑动
- setPadding()
更多相关文章
- NDROID中LISTVIEW仿QQ群组向上滚动特效
- Android(安卓)AWS S3文件服务器User Pool Identity Pool接入
- Android(安卓)提醒用户输入错误的方法
- Android(安卓)setContentView 源码解析
- cocos2d怎么设置屏幕朝向?横屏 or 竖屏设置
- 【6.21】PreferenceActivity来设置setting菜单
- 2-3-9 RatingBar
- Android控件属性——是否可见和可点击
- Android(安卓)-- NotificationManager and Notification学习笔记