2

Recently I want to write a custom view which is related to scroll. When I use scrollTo(100,0), accounting the view will move right, but the result is that the view move left.

I know scrollTo means that the view content moves not the view moves, but the official docs not say it clearly. I am really confused about it.

Axel Guilmin
  • 11,454
  • 9
  • 54
  • 64
Howard
  • 21
  • 1
  • 2

1 Answers1

2

android:scrollX

The initial horizontal scroll offset, in pixels.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).

android:scrollY

The initial vertical scroll offset, in pixels.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).

Read this link

Amna Mirza
  • 705
  • 1
  • 5
  • 21