简体   繁体   中英

MapView doesn't take up full screen

I hate to bother you all again, as this is probably me, a newbie, making some big blunder, but I'm baffled as to why my mapview only takes up a fraction of the screen. I've been following tutorials. My layout:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">

<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="MY_API_KEY"
/>

<RelativeLayout>

The specified screen resolution is, as in the droid, 854x480. It shows up in the emulator in horizontal mode (wide, not very tall). The map starts about a third of the way from the left and ends about a third of the way from the right. It starts at the top and ends about a third of the way from the bottom of the screen. I have no clue why that would happen, as I specified "fill_parent".

Thoughts?

Fixed it. I know what broke it, although I don't know why it broke it. I had manually spelled out the Droid's resolution instead of selecting a preset, but had left unchanged the DPI from the initial 160. For some reason, this caused all apps deployed from eclipse to show up as too small, yet all apps that came with the emulated droid were a perfectly normal size. Go figure. :P

Either way, the fix was to rebuild the droid using a resolution preset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM