android - how to display scrollView already scrolled 20% on startup of activity -
i have made android activity in have put scrollview,now want when open activity,it should alreay scrolled 20% ,but should scrolled down after that,i have tried many links , refrences that,but failed that,can please me how can it,my xml code below scrollview,i have put image,i want scrollview show scrolled fixed height on startup of activity.
main.xml
<scrollview android:id="@+id/scr_profile" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fillviewport="true" android:scrolly="200dp" android:scrollbars="none" > <relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent" > ...... </scrollview>
have try runnable?
final scrollview scroll = (scrollview) this.findviewbyid(r.id.scr_profile); scroll.post(new runnable() { @override public void run() { scroll.scrollto(200, 200); } });
this work me.
Comments
Post a Comment