0

I'm using original Gallery app from the ICS source code. And Now the thing is, I want to disable the horizontal scroll and implement it by vertical scroll in Grid. How to do this ?

KingCrunch
  • 128,817
  • 21
  • 151
  • 173
indraja machani
  • 679
  • 1
  • 9
  • 25

2 Answers2

0

try this

Add android:screenOrientation="portrait" to the activity in the AndroidManifest.xml. For example:

    <activity android:name=".SomeActivity"
          android:label="@string/app_name"
          android:screenOrientation="portrait">

Or try like this...

One programmatic way of doing this, that I can think of, is to create a super class that extends activity and extend all your classes from there.

Have the below setting in the super class in a protected method and call super.xxx() to initiate this:

setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

In case you what a specific activity in a different way you can simply override this.

[I have not tried this yet, but by the knowledge of OOP this works]

Rahul Baradia
  • 11,802
  • 17
  • 73
  • 121
0

try this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<ScrollView android:id="@+id/ScrlView" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" >

<Gallery android:id="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"/>

</ScrollView>
</LinearLayout>
SubbaReddy PolamReddy
  • 2,083
  • 2
  • 17
  • 23