利用ScrollView滑动属性实现点击查看更多
2015-09-15 10:31
323 查看
利用ScrollView的滚动实现点击查看更多
效果图更新内容布局
<ScrollView android:id="@+id/sv_des" android:layout_width="match_parent" android:layout_height="@dimen/DIMEN_120PX" android:layout_marginLeft="@dimen/DIMEN_50PX" android:layout_marginRight="@dimen/DIMEN_50PX" android:layout_marginTop="@dimen/DIMEN_20PX" android:overScrollMode="never" android:scrollbars="none" > <TextView android:id="@+id/tv_des" android:layout_width="match_parent" android:layout_height="wrap_content" android:lineSpacingExtra="@dimen/DIMEN_10PX" android:textColor="#FF262626" android:textSize="@dimen/DIMEN_28PX" /> </ScrollView>
了解更多布局
<TextView android:id="@+id/tv_loadMove" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="@dimen/DIMEN_50PX" android:paddingTop="@dimen/DIMEN_30PX" android:singleLine="true" android:text="@string/update_tip_load_more" android:textColor="#FF0E76A8" android:textSize="@dimen/DIMEN_26PX" />
获取控件
获取ScrollViewScrollView mSvDes = (ScrollView) view.findViewById(R.id.sv_des);
获取了解更多
// 了解更多 TextView mTvLoadMove = (TextView) view.findViewById(R.id.tv_loadMove);
控制ScrollView滚动
向上滚动ScrollView的高度的距离,显示下部分内容mSvDes.smoothScrollTo(0, mSvDes.getScrollY() + mSvDes.getMeasuredHeight());
相关文章推荐
- HTML5 CSS3 精美案例 : 达到VCD盒个性幻灯片
- 27.Remove Element(Array)
- 阿里服务器配置swap
- o怎么样racle输入dmp数据库文件
- 稻盛和夫:人该如何合理地与欲望共度一生
- JS实现仿FLASH效果的竖排导航代码
- iOS 禁止横屏
- WinIO3.0在win7 64位系统下的使用
- word转pdf还有什么好的方法
- c#正则替换之Regex.Escape
- webservice
- 51nod 1429:巧克力
- 二十岁出头的时候上,你一无所有,你拥有一切。
- MFC中listbox控件中各种属性的详解
- 51nod 1429:巧克力
- GTM同步测试日志
- sql server 中将由逗号“,”分割的一个字符串,转换为一个表,并应用与 in 条件...
- sql server 中将由逗号“,”分割的一个字符串,转换为一个表,并应用与 in 条件
- STL容器stack栈
- html iframe高度自适应