Skip to main content
deleted 19 characters in body
Source Link
Anand Tripathi
  • 16.4k
  • 2
  • 52
  • 57

I have created one activity which is containing one map,image image and otheranother text view,and i and I have added "scrollview" tag for it ...but But after the activity startedstarts it scrolls to the end of the page automatically....please Please tell me why this happendshappens and how to stop it formfrom moving to end so iI can scroll it by myself.

this is my code:

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:orientation="vertical" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.radikallab.earch.DetailsActivity" android:background="@drawable/background10"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="25dp" android:text="Title" android:textStyle="italic"/> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/background4" android:id="@+id/iv"/> <TextView android:id="@+id/rat" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="20sp" android:text="Title" android:textStyle="italic"/> <TextView android:id="@+id/addr" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="17sp" android:text="Title" android:textStyle="italic"/> <WebView android:layout_width="match_parent" android:layout_height="500dp" android:layout_marginTop="10dp" android:id="@+id/webView" android:layout_gravity="center_horizontal" /> </LinearLayout> 

I have created one activity which is containing one map,image and other text view,and i have added "scrollview" tag for it ...but after the activity started it scrolls to the end of the page automatically....please tell me why this happends and how to stop it form moving to end so i can scroll by myself.

this is my code:

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:orientation="vertical" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.radikallab.earch.DetailsActivity" android:background="@drawable/background10"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="25dp" android:text="Title" android:textStyle="italic"/> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/background4" android:id="@+id/iv"/> <TextView android:id="@+id/rat" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="20sp" android:text="Title" android:textStyle="italic"/> <TextView android:id="@+id/addr" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="17sp" android:text="Title" android:textStyle="italic"/> <WebView android:layout_width="match_parent" android:layout_height="500dp" android:layout_marginTop="10dp" android:id="@+id/webView" android:layout_gravity="center_horizontal" /> </LinearLayout> 

I have created one activity which is containing one map, image and another text view, and I have added "scrollview" tag for it. But after the activity starts it scrolls to the end of the page automatically. Please tell me why this happens and how to stop it from moving to end so I can scroll it by myself.

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:orientation="vertical" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.radikallab.earch.DetailsActivity" android:background="@drawable/background10"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="25dp" android:text="Title" android:textStyle="italic"/> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/background4" android:id="@+id/iv"/> <TextView android:id="@+id/rat" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="20sp" android:text="Title" android:textStyle="italic"/> <TextView android:id="@+id/addr" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="17sp" android:text="Title" android:textStyle="italic"/> <WebView android:layout_width="match_parent" android:layout_height="500dp" android:layout_marginTop="10dp" android:id="@+id/webView" android:layout_gravity="center_horizontal" /> </LinearLayout> 
Made the title reflect the nature of the question
Link

Android -->ScrollingScrollView automatically scrolls to the bottom of the view

Your expression doesn't look so clear that others can understand.
Source Link
starkshang
  • 8.6k
  • 8
  • 46
  • 58

I have created one activity which is containing one map,image and other text view,and i have added "scrollview" tag for it ...but after the activity started it is automatically scrollingscrolls to the end of the page automatically....plzplease tell me why this happends and how to stop it form moving to end???...so so i can scroll by myself....my code

this is... my code:

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:orientation="vertical" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.radikallab.earch.DetailsActivity" android:background="@drawable/background10"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="25dp" android:text="Title" android:textStyle="italic"/> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/background4" android:id="@+id/iv"/> <TextView android:id="@+id/rat" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="20sp" android:text="Title" android:textStyle="italic"/> <TextView android:id="@+id/addr" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="17sp" android:text="Title" android:textStyle="italic"/> <WebView android:layout_width="match_parent" android:layout_height="500dp" android:layout_marginTop="10dp" android:id="@+id/webView" android:layout_gravity="center_horizontal" /> </LinearLayout> 

I have created one activity which is containing one map,image and other text view,and i have added "scrollview" tag for it ...but after the activity started it is automatically scrolling to the end of the page ....plz tell me how to stop it form moving to end???...so i can scroll by myself....my code is...

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:orientation="vertical" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.radikallab.earch.DetailsActivity" android:background="@drawable/background10"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="25dp" android:text="Title" android:textStyle="italic"/> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/background4" android:id="@+id/iv"/> <TextView android:id="@+id/rat" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="20sp" android:text="Title" android:textStyle="italic"/> <TextView android:id="@+id/addr" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="17sp" android:text="Title" android:textStyle="italic"/> <WebView android:layout_width="match_parent" android:layout_height="500dp" android:layout_marginTop="10dp" android:id="@+id/webView" android:layout_gravity="center_horizontal" /> </LinearLayout> 

I have created one activity which is containing one map,image and other text view,and i have added "scrollview" tag for it ...but after the activity started it scrolls to the end of the page automatically....please tell me why this happends and how to stop it form moving to end so i can scroll by myself.

this is my code:

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:orientation="vertical" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.radikallab.earch.DetailsActivity" android:background="@drawable/background10"> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="25dp" android:text="Title" android:textStyle="italic"/> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/background4" android:id="@+id/iv"/> <TextView android:id="@+id/rat" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="20sp" android:text="Title" android:textStyle="italic"/> <TextView android:id="@+id/addr" android:layout_width="match_parent" android:layout_height="wrap_content" android:textSize="17sp" android:text="Title" android:textStyle="italic"/> <WebView android:layout_width="match_parent" android:layout_height="500dp" android:layout_marginTop="10dp" android:id="@+id/webView" android:layout_gravity="center_horizontal" /> </LinearLayout> 
Source Link
Loading