Android: nine-patch is centered on one device, but moves somewhat to the right on another
I have a nine-patch image I put on a the background of a full-screen view: And it looks as I want it on 800x480 and 1280x720 screens: it is has some equal transparent space on left and right sides. But on the FullHD screen the clear space on the left side is twice bigger than the space on the right side. But I have only one black pixel on both sides, so the clear spaces should be equal. Then I modified my image like this: And now it looks centered on FullHD screen, but moved to the right on 800x480. How can I make it look centered on all the devices? Now first image looks like this on FullHD device (this is the bottom part of the view): and the second: and they look vice-versa on 800x480 device. The layout is as simple as this: ImageView ib = new ImageView(this); ib.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); ib.setBackgroundResource(R.drawable.scroll_both_ver); setContentView(ib); Upd: The solution was to provide a copy in each of drawable-* folders.
Your 9 patch top center black area is not centered well, it has more space on the right than on the left. Not sure how this can explain your problem, but try to adjust it
ViewSwitcher with Next and Prev Button
how to open an attachment with my applicacion from within the email app? (mime type, intent filter …)
Google Analytics V2 - IllegalStateException - can I initialize in onCreate() instead of onStart()
ANDROID open source lib to do graphics in real time
Does android has something like onDate listener?
ListPreference with Image in Live Wallpaper android (ImageListPreference)
Android Instantiation error i.e Unable to instantiate activity
Convert String to DateTime format of google APIs
How to access Assets Subfolder of installed applications in android
Profiling on Android with pg option
RSA Encryption Decryption in Android
How to dispaly a videoview in full screen in Dialog?
Android getting resource drawables in library project
What does “status -12” mean in Android AudioTrack?
Time calculation on mobile devices