• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to add an Image icon on the Scrollview??

wagyaoo

Lurker
I am new to Android development, kind of 2-weeks beginer. Recently, I have been dealing with android layout and my first app was based on wifi location, and the icon was used to indicate the current location. What I found was that it was really difficult to programmly add an imageview on top of a Scrollview at certain position. Only succeed by using the deprecated AbsoluteLayout with new AbsoluteLayout.LayoutParams(width, height, x, y). But there should be other ways to deal with it, like Google map, after zooming or scrolling the location indicator is still pointed right.

Hope I can find some help here. Thanks!
 
Use a RelativeLayout or FrameLayout to encapsulate both the ScrollView and the View that you wish to add. You can then use padding, margins and device independant positions to tweak the exact placement.
 
Back
Top Bottom