I have two images in drawable. I am using the ImageView to display them. However, I want to display each image individually by hand. At the first, I want to display image1.png. When I scroll left to right, it will be display images image2.png. Could you suggest to me the way to do it? Thank you so much
you can use ViewPager see this example http://developer.android.com/training/animation/screen-slide.html
can anyone let me know how to keep an image on top of other image. If we select a portion of the top image it should display the below image portion.
Please share the samp
Thanks in advance.
-pavan
I'm not sure if this would completely answer your question... but firstly, images shouldn't really ever overlap in a LinearLayout. If you're using a RelativeLayout, they definitely can overlap, and the image on top will be whatever was loaded last in the XML.
If I understand what you're attempting to do - kind of transparency (so to speak) of the top image so that portions of the bottom image are displayed along with portions of the top image ... I do things like that all the time by overriding the onDraw() method on my View to handle the image painting myself. There's allot of examples on the net for this - simple stuff.
I am displaying an image gallery consisting of 15 images with image displayed on the screen (full-screen) at a time. When the user swipes across, the image changes. I am looking at a small polka-dots style indicator at the center-bottom of the screen to show the image count and where the user currently is.
eg: If my gallery held 5 images and the user was currently on the 3rd image, then there would be 5 polka dots with 3rd dot highlighted/filled with color and the rest polka-dots be hollow.
I know the description might sound a little vague but in short, I am looking at an image count indicator! :)
Thanks!
You might check out this Android Count Indicator project: https://github.com/rupertbates/android-count-indicator
I know exactly what you want, you are looking for the PageControl that is used on iPhones with the Scroll Views. I have never seen anything like that for Android. You would have to build a custom view. It's explained here:
Building Custom Android Components
I finally found it in the Launcher code!
Hi I am using the gallery for displaying images. But the gallery has an end. I don't want this behaviour; I want to repeat the images again and again on both sides of the gallery. Is there a way to display the gallery elements as a circle?
I wrote a tutorial on how to create circular gallery.
Read it in my Blog Post here:
http://evgeni-shafran.blogspot.com/2011/08/tutorial-custom-gallery-circular-and.html
Here is what i did:
In the adapter i used, i made him think he have a really big element count.
and then each element position= position%element.lenght
and then i made the first position in the middle.
so what happen is this: (lets do it for 3 elements, you can have what ever amount you like later)
This is how the adapter see the elements:
1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3
now you tell him that the first element is in the middle:
1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,->1<-,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3
if you make it a really big number, the user can scroll a lot before getting to the end.
Hope it helped you.
I have a layout in which I am displaying a webview. I want to add images on top of the webview at specific places through code.
Can some one please tell me how to do that?
The translucent background example in API Demos makes the view cover the whole screen. I want to place only a small image and at a specific location (origin not 0,0)
Thanks a lot.
Have you tried putting both the WebView and the ImageView inside an Absolute Layout? This should let you specify the X/Y location of your image and by ordering make it constantly drawn over the webview.
EDIT: check out the Absolute layout:
http://developer.android.com/guide/topics/ui/layout-objects.html#absolutelayout
AbsoluteLayout is deprecated and if that bothers you, you may want to look for alternative.
I have put an example in my blog post here. It might not be exactly what you are after, but should give you an idea:
http://anothermobiledeveloper.blogspot.com/2011/10/using-relativelayout-instead-of.html