Adding scrollbars in a Custom View

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


Sponsored Links
 Hi,

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.
Thanks!

--



Adding scrollbars in a Custom View

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


 Hi,

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.

BR
Jonas




--


Sponsored Links


Other Threads

1. Starting Text to Speech activity

Hi,

I can successfully call the code below from the parent process with
speaker.sayHello() and it works as expected.  What I want to do is to
call speaker.sayHello() from a livewallpaper rather than a foreground
activity.  I've tried to start the activity with this code in the
parent :-

Intent i = new Intent(context, speaker.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);

after removing these lines from the manifest :-

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

but I get a Force Close.  Can somebody point out what I'm doing wrong.

Thanks,
Simon.


speaker.java :-

import android.speech.tts.*;
import android.app.Activity;
import android.os.Bundle;

public class speaker extends Activity {
    /** Called when the activity is first created. */
        private static TextToSpeech myTts;

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        myTts = new TextToSpeech(this, ttsInitListener);
    }
    private TextToSpeech.OnInitListener ttsInitListener = new
TextToSpeech.OnInitListener() {
        public void onInit(int version) {
        }
    };

   public static void sayHello()
   {
          String myText1 = "Hello";
          myTts.speak(myText1, 0, null);

   }
}



AndroidManifest.xml :-

<activity android:name=".speaker"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category
android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
</activity>

-- 

2. Emma code coverage for UI events on device

Hi,

I would like to measure the code coverage for the UI application
without using JUnit test cases. Is there any way that we can capture
the report for the user key events on the application which is running
on device.

Thanks,
Android user.

-- 

3. FourCC code for PixelFormat YCbCr_422_SP?

4. Good Cannels to Generate Larger Revenue

5. about late resume, when PowerManagerService write on to /sys/power/state to call late resume

6. App released but only tested using the emulator. Could you please test it to me?

7. how to read database of one application in another application using contentproviders