布局文件,如下<?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:background="#ffffff">
 <ImageView android:id="@+id/img1" 
    android:src="@drawable/new01"
android:layout_width="fill_parent" 
android:layout_height="fill_parent" />
</LinearLayout>现问题是:图片不能位于顶部,现在是位于中间,现如何让图片位于顶部呀 thanks

解决方案 »

  1.   

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:background="#ffffff"
                android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
        android:orientation="vertical" android:gravity="top|center_horizontal">
            <ImageView
                android:id="@+id/img1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/new01" />
    </LinearLayout>