为了账号安全,请及时绑定邮箱和手机立即绑定

ScrollView 滚动到某个指定 ID 的 View

ScrollView 滚动到某个指定 ID 的 View

回首忆惘然 2019-03-14 14:11:40
我想通过ID(也就是View),进行 ScrollView 的滚动,但是没有成功。用下面的例子如何实现呢?<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical" >     <LinearLayout        android:layout_width="fill_parent"        android:layout_height="fill_parent" >     <Button         android:id="@+id/pressMe"        android:layout_height="wrap_content"        android:layout_width="wrap_content"        android:text="Press me to scroll to A">     <ImageView        android:id="@+id/scrollToMe"        android:layout_height="100dp"        android:layout_width="fill_parent"        android:layout_marginTop="2000dp"        android:background="#f00">     </LinearLayout> </ScrollView>
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1256 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号