0

How can I make a vertical linear Layout always scrollable, even when I only have one TextView in my Layout?

  • When I scroll up, I want it to scroll and show a blank space at the bottom.
  • When I scroll down, I want it to show a blank at the top of my view.

Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ScrollView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
             android:id="@+id/addCategory"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="Scrollable view"/>
    </LinearLayout>
</ScrollView>
Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
Mock
  • 29
  • 4
  • maybe this can give you some hints http://stackoverflow.com/questions/14747525/how-can-i-make-bounce-effect-to-listview-as-in-ios . But as said in the developers sheets, don't try to achieve another os UI – mihail May 16 '13 at 14:21

1 Answers1

0

You can't do it by any default API provided by android, yet programatically You are looking for this -

Horizontal Pager.

This has been answered here on this question already -

Android horizontal scrollview behave like iphone scroll

Community
  • 1
  • 1
Darpan
  • 5,623
  • 3
  • 48
  • 80