Search code examples
androidandroid-gallery

How to align first gallery item to the left?


By default, gallery is center aligned. The behavior I want, is to left align the first item in the parent layout instead of centering it. How it can be done? I have also gone through the link : https://stackoverflow.com/questions/4341158/android-align-first-item-in-gallery-to-the-left

But that doesn't work for 2.3.x devices. How can I achieve it?


Solution

  • The Answer in the link provided: https://stackoverflow.com/questions/4341158/android-align-first-item-in-gallery-to-the-left working perfectly fine. The problem is that I had wrapped Gallery in FrameLayout and hence it is not working when I changed it to RelativeLayout, it is working fine.