Scrollbar not working

by New Developer » Sun, 27 Mar 2011 20:11:22 GMT


Sponsored Links
 I have the following in the XML
<TableLayout android:id="@+id/TableLayout01" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:scrollbars="vertical"
    android:scrollbarSize="20dp"
    android:scrollbarAlwaysDrawVerticalTrack="true"
    android:stretchColumns="*">
    <TableRow>
      <ListView
        android:id="@+id/main_list" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:smoothScrollbar="true"
        android:fastScrollEnabled="true"
        android:scrollbars="vertical"
        android:scrollbarStyle="insideInset"
        android:scrollbarSize="20dip"
        android:textColor="#00ee00"></ListView>
    </TableRow>
  </TableLayout>

I add the items dynamically from a database using

private ListView  listView = null;
listView = (ListView) findViewById(R.id.main_list);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

It shows a very narrow scrollbar.
But the list does not scroll and the scroll bar has no effect, which I click 
the scrollbar to move it
the scrollbar fades away.  any Ideas ?


Thanks in advance

-- 



Re: Scrollbar not working

by Mark Murphy » Sun, 27 Mar 2011 20:28:34 GMT


 Android does not use scrollbars for more than a momentary display of
position. This is by design. The concept of a scrollbar as being the
mechanism for scrolling is for mouse-based UIs. Touchscreens scroll
via gestures sliding the whole thing up and down.

I strongly encourage you to use some touchscreen hardware -- whether
or not it is an Android phone -- before you start attempting to write
Android applications.






-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android Training in Oslo:  http://bit.ly/fjBo24 

-- 


Sponsored Links


Re: Scrollbar not working

by New Developer » Sun, 27 Mar 2011 23:43:38 GMT


 Thanks

I have tried an android phone
Okay let me ask this  how then to you correctly test a ListView  with a scroll  
on the emulator ??
What is the correct method ?

Thanks again






-- 



Re: Scrollbar not working

by Mark Murphy » Sun, 27 Mar 2011 23:45:52 GMT


 Use your mouse to simulate a finger.








-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android Training in Oslo:  http://bit.ly/fjBo24 

-- 



Other Threads

1. play audio from a stream in android...

Hi All,

How to play audio from a stream in android???

I will get input stream  from an online link( like continuous FM).

I need to cache the stream and play it.

I searched a lot in sites,,,but didnt get.They show option of playing from a
stored file.

There is no option to play from a stream.

Can anyone help me please,,Itz very urgent for my project.

Thanks
Kavitha

-- 

2. CacheManager.getCacheFileBaseDir() always returns null

Hi,

I've been trying to use the CacheManager for caching some http
requests but it failed every time with a nullpointer exception. After
some digging I believe I found out why:

CacheManager.getCacheFileBaseDir() always returns null so when I try
to use CacheManager.getCacheFile() or CacheManager.saveCacheFile()
they fail.

CacheManager.cacheDisabled() returns false :S

I hadn 't created a cache partition via the AVD manager so I thought
the problem lie there. But after creating a cache partition
getCacheFile() still return null:

03-16 00:25:16.321: ERROR/AndroidRuntime(296): Caused by:
java.lang.NullPointerException
03-16 00:25:16.321: ERROR/AndroidRuntime(296):     at
android.webkit.CacheManager.getCacheFile(CacheManager.java:296)

What could be the problem? I've got the code posted here:
http://pastebin.com/eaJwfXEK
But it's a bit messy because I've been trying tons of stuff.

-- 

3. how to Play music from AudioTrack

4. Network connectivity checking without wakelock

5. VDC is Interested in Your Engineering Experiences

6. Design for Battery Life

7. The server could not process your apk. Try again.