How to show an Image gradually within the ScrollView?

edgervivyk

New Member
Is there any process to increase the height of ScrollView gradually at run time. My intention is to show an image gradually which is within the ScrollView.So I want to increase the height of ScrollView. Is there any way to do my job?? Please help me out.Content of my XmlFile is :\[code\]<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rootLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="80dp" android:scrollbars="none" android:layout_x="0dp" android:layout_y="0dp" android:fillViewport="true" > <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="0dp" android:layout_y="0dp" android:src="http://stackoverflow.com/questions/11465422/@drawable/background" /> </LinearLayout> </ScrollView> </LinearLayout>\[/code\]my code is :\[code\]final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { runOnUiThread(new Runnable() { public void run() { secondCounter++; yourNewHeight += 10; // sv is object of scroll view sv.getLayoutParams().height = yourNewHeight; root.invalidate(); // root is rootview if(secondCounter == 20){ timer.cancel(); } } }); } }, delay, period);\[/code\]Here is my screen shot:
tzAzd.png
the blurred image is with in the Scrollview and as height of ScrollView increasing the blurred image is showing gradually.
 
Back
Top