Nick
Nick

Reputation: 820

android: UI on real device problem

I wrote simple aplication for android. It works great in emulator. But when I installed it on real device (htc wildfire) then the interface became ugly. Except that it works good. TextViews look fine but the buttons, sprinners and list items look bad. Button corners seem wretched. All the lists (list view and list preference have no delimeter(line) between rows! When I scroll a bit the delimeter appears). Why?

Upvotes: 0

Views: 187

Answers (3)

Manish Burman
Manish Burman

Reputation: 3079

The buttons probably become stretched because you're not using 9 patch images. Here's a good tutorial on 9 patch images http://developer.android.com/guide/developing/tools/draw9patch.html

Regarding the list view, you might want to set this field inside listview in your xml file
android:cacheColorHint="#00000000". That might do the trick.

Upvotes: 2

adamp
adamp

Reputation: 28932

Have you specified a targetSdkVersion in the uses-sdk tag in your manifest? If you haven't, Android will assume your app does not know about newer platform versions with different screen sizes/densities and run your app with compatibility scaling.

You should always set targetSdkVersion to the newest version of Android that you are targeting. This helps let Android know what compatibility behaviors to use for your app if things changed in newer versions. targetSdkVersion can be greater than minSdkVersion, meaning your app knows how to take newer platform features into account while remaining compatible with a minimum version.

Upvotes: 1

Seva Alekseyev
Seva Alekseyev

Reputation: 61380

Most likely, screen density is different on the device. Instead of specifying sizes in pixels (px), use sp for font size and dp for everything else. This way they will scale properly.

Upvotes: 1

Related Questions