1

I have the following in my main.xml the image marker does not fill the width of the device?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:screenOrientation="portrait">

<ImageView 
    android:id="@+id/ImageView01" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent"        
    android:src="@drawable/marker">
</ImageView>

</LinearLayout>
Hassy31
  • 2,793
  • 3
  • 21
  • 37
james tyner
  • 55
  • 4
  • 8

2 Answers2

6

You have your ImageView's height set to wrap_content. This means the ImageView will only take as much space as is needed by the image you select. If you want it to take the entire screen, just change your layout_height to fill_parent.

You'll also want to select an ImageView scaleType with android:scaleType="".

Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
  • I did have the width set to fill_parent above?I will check into the scaleType. Just now it worked.This emulator is buggy as hell,half the time it works half the time it don't. – james tyner Nov 21 '10 at 06:06
  • Er, I meant height, sorry. I'll edit that in. Change your ImageView's height. – Kevin Coppock Nov 21 '10 at 06:10
1

try

android:adjustViewBounds="true"

or check out

image_view_1.xml

in the Android APIDemos.

It should be of help.

Some Noob Student
  • 14,186
  • 13
  • 65
  • 103