Adding scrollbars in a Custom View

by Neha » Fri, 05 Mar 2010 18:15:40 GMT

Sponsored Links

I am working on adding vertical and horizontal scrollbars in a custom
drawn View. I have overridden the compute*ScrollOffset,
compute*ScrollRange, etc methods and have enabled the scrollbars by
called set*ScrollBarEnabled. However, I do not see the scrollbars in
my View, even after a call to scrollBy, which according to the
documentation calls awakenScrollbars (I assumed awakenScrollbars is
not required as the scrollbars do not auto-fade -
isScrollbarFadingEnabled returns false).
Does anyone have a sample with scrollbars in a custom view which they
can share? Or provide any pointers as to how this should be fixed?

Any help would be appreciated.


Adding scrollbars in a Custom View

by Jonas » Fri, 23 Apr 2010 08:04:53 GMT


Did you get any help with this question, I am having the same problem.
No scroll bars are displayed. I also wish to get the Y position of the
scrollbar and see if it is bigger or smaller than screen width / 2.



Sponsored Links

Other Threads

1. Run Android 2.0.1 on HTC magic

Hi all,
I'm trying put the Android 2.0.1 run in HTC magic. I already compile
all source code with HTC magic drivers. I flash the new system.img on
system partition and the system start well. however when run the
desktop i get some errors:

I/ActivityThread(  180): Publishing provider
D/installd(   68): DexInv: --- BEGIN '/system/app/VoiceDialer.apk' ---
I/ActivityThread(  180): Publishing provider
I/ContactsDatabaseHelper(  180): Bootstrapping database
E/Database(  180): Failure 14 (unable to open database file) on
0x1485f0 when executing 'CREATE UNIQUE INDEX nickname_lookup_index ON
nickname_lookup (name, cluster);'
E/SQLiteOpenHelper(  180): Couldn't open contacts2.db for writing
(will try read-only):
E/SQLiteOpenHelper(  180): android.database.sqlite.SQLiteException:
unable to open database file: CREATE UNIQUE INDEX
nickname_lookup_index ON nickname_lookup (name, cluster);

W/dalvikvm(  180): threadid=3: thread exiting with uncaught exception
E/AndroidRuntime(  180): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime(  180): java.lang.RuntimeException: Unable to get
android.database.sqlite.SQLiteException: Can't upgrade read-only
database from version 0 to 105: /data/data/

someone know how i resolve this trouble?

Best Regards,
Andr Barbosa.


2. Android Emulator without a Camera, != null ????


So I made an AVD with set to no, the default. I have uses
feature for both camera and autofocus set and required=false. I also
have the Camera permission set. I just want to make sure I don't
expose a confusing UI to people without a camera. So I thought this
would make the OS uphold the contract for
which should return null ... but it never does? What's the deal?


3. SipManager 2.3 SDK

4. Getting relative positions of elements in a grid view

5. how to build an unsigned application in the source code

6. listing all installed certificates on android device

7. switch between two or more screens